以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  关于加载数据时间的问题  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=20131)

--  作者:yankunhao
--  发布时间:2012/5/30 8:44:00
--  关于加载数据时间的问题

我做了个窗口比如按产品的系列进行加载数据,发现有些系列产品比较少时,加载很快,但有些系列的产品比较多,加载时约1分钟才加载完,我想实现当加载数据比较多时能提示用户"数据正在加载,请稍候...."等类似的提法,请问有什么好的方法吗?


--  作者:狐狸爸爸
--  发布时间:2012/5/30 9:02:00
--  

看看:

http://www.foxtable.com/help/topics/0639.htm

 

不过我建议你采用分页加载,以减少加载量,此外加载前屏蔽所有事件,加载后重新开启事件。


--  作者:yankunhao
--  发布时间:2012/5/30 11:09:00
--  

我在设计的窗口中有个combox5控件它的ValueChanged事件代码如下,窗口中还有个ProgressBar1,我想在下面代码中加相关加载显示进度的代码,试了好几个方法都没效的,请问有没好的方法呢?

 

try
Dim s As String
s=e.Sender.Text
Dim ids As String
Dim drs As List(Of DataRow)
drs = DataTables("料品资料查询表").Select("type_name = \'" & s &"\'")

For Each dr As DataRow In drs
    ids = ids & ",\'" & dr("part_no") & "\'"
Next
ids= ids.Trim(",")
DataTables("obas_part_spec").LoadFilter = "part_no In (" & ids & ")"
DataTables("obas_part_spec").Load()
Catch ex As Exception
MessageBox.Show("没找到相关数据!","提示",MessageBoxButtons.OK)

End Try
try
Dim s1 As String = Tables("obas_part_spec").Current("part_no")
Dim s2 As String ="0"
Dim t As WinForm.Table = e.Form.Controls("Table1")
If e.Form.Controls("TextBox1").Text <> "" Then
    t.Table.Fill("SELECT parent_part as 内部编码,child_part,Left(unit_qty,4) As 数量,bom_sort As 排序,ov_part.item_no As 物料编码,ov_part.part_name As 名称,ov_part.part_spec As 规格,obas_part1.bom_draw_no As 图号 from obom_stru2 INNER JOIN ov_part on obom_stru2.child_part = ov_part.part_no INNER JOIN obas_part1 on obom_stru2.child_part = obas_part1.part_no where parent_part=\'" & s1 & "\'ORDER BY 排序","erp",True)
    t.Table.SetColVisibleWidth("物料编码|75|名称|75|规格|120|数量|18|图号|60")
Else
    t.Table.Fill("SELECT parent_part as 内部编码,child_part,Left(unit_qty,4) As 数量,bom_sort As 排序,ov_part.item_no As 物料编码,ov_part.part_name As 名称,ov_part.part_spec As 规格,obas_part1.bom_draw_no As 图号 from obom_stru2 INNER JOIN ov_part on obom_stru2.child_part = ov_part.part_no INNER JOIN obas_part1 on obom_stru2.child_part = obas_part1.part_no where parent_part=\'" & s2 & "\'ORDER BY 排序","erp",True)
    t.Table.SetColVisibleWidth("物料编码|75|名称|75|规格|120|数量|18|图号|60")
End If
Catch ex As Exception
Dim s2 As String ="0"
Dim t As WinForm.Table = e.Form.Controls("Table1")

t.Table.Fill("SELECT parent_part as 内部编码,child_part,Left(unit_qty,4) As 数量,bom_sort As 排序,ov_part.item_no As 物料编码,ov_part.part_name As 名称,ov_part.part_spec As 规格,obas_part1.bom_draw_no As 图号 from obom_stru2 INNER JOIN ov_part on obom_stru2.child_part = ov_part.part_no INNER JOIN obas_part1 on obom_stru2.child_part = obas_part1.part_no where parent_part=\'" & s2 & "\'ORDER BY 排序","erp",True)
t.Table.SetColVisibleWidth("物料编码|75|名称|75|规格|120|数量|18|图号|60")

MessageBox.Show("没找到相关数据!","提示",MessageBoxButtons.OK)

End Try

[此贴子已经被作者于2012-5-30 11:09:40编辑过]

--  作者:狐狸爸爸
--  发布时间:2012/5/30 11:21:00
--  
没有办法显示加载进度的