Dim dr As Row = e.Row
Dim dr1 As DataRow
Dim i As Integer=6
If e.Col.Name = "主机_有线MAC" Then
If e.Text.Length = 12 Then
For Each dc As DataCol In DataTables("交换机").DataCols
dr1 = DataTables("交换机").Find(" dc Like '%" & e.Row("主机_有线MAC") & " '")
If dr1 IsNot Nothing Then
Dim ColNames As String() = {"交换机_主机名","交换机_IP地址"}
For Each ColName As String In ColNames
dr(ColName) = dr1(ColName)
Next
End If
Next
Else
MessageBox.show("请输入12位MAC地址")
End If
End If
请教这一段代码 在find后面的表达式应该如何写?我是从另张表(交换机)里查找想要的内容。
[此贴子已经被作者于2013-6-29 9:31:48编辑过]