老师,跨表引用慢,怎么解决呢?
Dim cmd As New SQLCommand
Dim dt As DataTable
cmd.C
cmd.CommandText = "S ELECT DISTINCT 合同编码,所属机构,项目名称,合同金额 From {合同签订}"
dt = cmd.ExecuteReader()
If e.DataCol.Name = "项目名称" Then
Dim nms()As String = {"合同编码","所属机构","合同金额"}
If e.NewValue Is Nothing Then
For Each nm As String In nms
e.DataRow(nm)= Nothing
Next
Else
Dim dr As DataRow
dr = dt.Find("[项目名称]= '" & e.NewValue & "'")
If dr IsNot Nothing
For Each nm As String In nms
e.DataRow(nm)= dr(nm)
Next
End If
End If
End If