以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  请问这样写有什么问题?  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=61090)

--  作者:czy
--  发布时间:2014/12/6 21:09:00
--  

有问题

如果编号列是字符型,代码为:

 

Dim r As Row = CurrentTable.Current
Dim drs As List(Of DataRow)
drs = DataTables("考勤表").Select("[编号] = \'" & r("编号") & "\'")
If drs.Count>0 Then
    For Each dr As DataRow In drs
        dr("姓名") =r("姓名")
        dr.Save
    Next
End If

 

如果编号列是数值型,代码为:

Dim r As Row = CurrentTable.Current
Dim drs As List(Of DataRow)
drs = DataTables("考勤表").Select("[编号] = " & r("编号"))
If drs.Count>0 Then
    For Each dr As DataRow In drs
        dr("姓名") =r("姓名")
        dr.Save
    Next
End If