Foxtable(狐表)用户栏目专家坐堂 → [求助]SQLReplaceFor更新数据


  共有2387人关注过本帖平板打印复制链接

主题:[求助]SQLReplaceFor更新数据

帅哥哟,离线,有人找我吗?
天一生水
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:五尾狐 帖子:1140 积分:11255 威望:0 精华:0 注册:2017/9/26 16:30:00
[求助]SQLReplaceFor更新数据  发帖心情 Post By:2020/6/18 21:03:00 [只看该作者]

老师好!

表"日线预测" 通过SQLFind在  表"实际日线"查找数据后赋值。但感到速度比较慢,如果改为SQLReplaceFor更新数据,下列的代码应该怎样修改?

 

Dim  drs As  List(of  DataRow) = DataTables("日线预测").SQLSelect("代码 = '" & nm & "'")
For Each  dr As  DataRow In drs
    Dim dr1 As DataRow = Tables("导入数据").DataTable.SQLFind("代码 = '" & nm & "'  And 日期 = '" & dr("日期") & "'" )
    If dr1 IsNot Nothing Then
        dr("实际日线") = dr1("涨跌幅")
    End If
Next
DataTables("日线预测").SQLUpdate(drs)


 回到顶部