我用以下代码进行数据复制,代码执行没有抱错,I变量也正常取到值了,但是来自DataTables("MainSchedule")表的R1行却没有任何变化呢?
Dim drs As new List(OF DataRow)
Dim i As Integer = 0
drs = DataTables("PttnSchdule").Select("RefreshToSampleschdule = 'false'")
If drs IsNot Nothing Then
For Each r As DataRow In drs
If r("SrsNO") IsNot Nothing Then
Dim r1 As DataRow = DataTables("MainSchedule").SQLFind("SrsNO = '" & r("SrsNO") & "'")
If r1 IsNot Nothing
r1("PttnRequest")= r("PttnRequest")
r1("pttnOrderTM")= r("pttnOrderTM")
r1("PttnRepresenter")= r("PttnRepresenter")
r1("PttnNO")= r("PttnNO")
r1("PttnKindCode")= r("PttnKindCode")
r1("patterner")= r("patterner")
r1("PatternLessReason")= r("PatternLessReason")
r1("PttnPrepareStu")= r("PttnPrepareStu")
r1("PttnPrepareTM")= r("PttnPrepareTM")
r("RefreshToSampleschdule") = True
i = i+1
End If
End If
Next
msgbox("检测到需要同步的数据共有 " & drs.Count & " 条, 成功同步 " & i & " 条;" )
Else
msgbox("没有检测到需要同步的数据;")
End If