代码如下,有问题吗?数据源里有6张表,现在有8500行,每一行不知道在具体哪张表上,要分别去每张表查。查询8500行用了半个小时。。。。。。。。这个速度太慢了吧。
Dim cmd As New SQLCommand
Dim dt As DataTable
cmd.C
For Each dtn As String In Connections("泉州").GetTableNames
cmd.CommandText = "SELECT * From {" & dtn & "} where [PVLAN] = " & e.DataRow("板/PVLAN") & " And [CVLAN] = " & e.DataRow("端口/CVLAN")
dt = cmd.ExecuteReader
If dt.DataRows.Count > 0 Then
e.DataRow("LOID") = dt.DataRows(0)("LOID")
e.DataRow("PON口") = dt.DataRows(0)("PON口")
e.DataRow("ONUID") = dt.DataRows(0)("ONUID")
exit for
Else
e.DataRow("LOID") = Nothing
e.DataRow("PON口") = Nothing
e.DataRow("ONUID") = Nothing
End If
Next
[此贴子已经被作者于2013-11-1 10:10:25编辑过]