老师好!下面这段需要加载后进行计算的代码,如果在后台进行,除了把GetValues改成SQLGetValues、把Select改为SQLSelect以外,还要修改什么地方?
谢谢!
Dim codes As List (Of String) = DataTables("指数日线").GetValues("代码","","日期")
For Each code As String In codes
Dim drlist As List (Of DataRow) = DataTables("指数日线").Select("代码 = '" & code & "'")
For i As Integer = 0 To drlist.Count - 1
If i = 0 Then
drlist(i)("涨跌幅") = (drlist(i)("收盘价") - drlist(i)("开盘价")) / drlist(i)("开盘价") * 100%
Else
drlist(i)("涨跌幅") = (drlist(i)("收盘价") - drlist(i - 1)("收盘价")) / drlist(i - 1)("收盘价") * 100%
End If
Next
Next