我用的是SQL数据库
下面这段代码,在双击的时候,结果没有出错,但是在加载的速度上很慢,我数据库只有300条数据,但是筛选后加载的时间需要3-4秒钟,并切目录树会有2秒钟的空白,然后再恢复显示。问题是出在什么地方呢? 谢谢!
Dim Filter As
String
Dim dr As DataRow = e.Node.DataRow '获取生成此节点的行
If e.Node.Text <> "显示所有数据......"
Then
Dim Year As Integer = e.Node.DataRow("年")
Dim Month As Integer = e.Node.DataRow("月")
Dim gb As String = e.Node.DataRow("车别")
Dim khdm As String = e.Node.DataRow("客户代码")
Select Case e.Node.Level
Case 0
Filter
= "1>1"
e.Form.Controls("Button6").Visible
= False
e.Form.Controls("Button02").Visible = False
Vars("车别") = ""
Case 1
Filter
= "1>1"
e.Form.Controls("Button6").Visible
= False
e.Form.Controls("Button02").Visible = False
Vars("车别") = ""
Case 2
Filter
="Year(装车日期) = " & Year & " And Month(装车日期)
= " & Month
& " And 车别
= '" & gb & "'"
e.Form.Controls("Button6").Visible
= True
e.Form.Controls("Button02").Visible
= True
Vars("车别") = gb
Vars("筛选条件") = "车别
= '" & gb & "'"
Case 3
Filter
="Year(装车日期) = " & Year & " And Month(装车日期)
= " & Month
& " And 车别
= '" & gb & "' and 客户代码 = '" &
khdm & "'"
Vars("车别") = gb
e.Form.Controls("Button6").Visible = True
e.Form.Controls("Button02").Visible
= False
End Select
End If
DataTables("装车明细").loadFilter = Filter
DataTables("装车明细").Load()