还有一个小问题:
Dim tb As Table = e.Form.Controls("Table1").Table
Dim Filter As String = ""
With e.Form.Controls("本期日期A")
If .Value IsNot Nothing Then
Filter = Filter & "日期 >= '" & .Value & "'"
End If
End With
With e.Form.Controls("本期日期B")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "日期 <= '" & .Value & "'"
End If
End With
With e.Form.Controls("项目")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "项目= '" & .Value & "'"
End If
End With
Dim dt As DataTable = Nothing
If Filter > "" Then
MessageBox.Show(1)
Dim q As New QueryBuilder
q.C
q.TableName = "账户明细"
q.SelectString = "S elect * Fr om {app013_账户明细表_账户明细} where " & Filter
q.Build()
这个代码 为啥加上条件 和 不加上条件 加载的速度有明显差别,不加上快 加上反而慢.
[此贴子已经被作者于2016/6/28 10:36:56编辑过]