以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 目录树加载速度很慢是什么原因? (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=128485) |
-- 作者:erdbeer -- 发布时间:2018/12/8 0:08:00 -- 目录树加载速度很慢是什么原因? 我用的是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() |
-- 作者:有点蓝 -- 发布时间:2018/12/8 8:57:00 -- 如果是远程数据库肯定会慢一点。 具体上传实例测试一下
|