100K项数据绑定:异步数据绑定是否可行? [英] 100K item data binding: Is asynchronous data binding possible?

查看:65
本文介绍了100K项数据绑定:异步数据绑定是否可行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




问题:我怎样才能快速将一个SqlServer查询的行返回

115,000项快速存入(或放入)ComboBox ?没有比

秒更长的时间,那就是...


场景:我正在重建我公司的Access 97 VBA数据库应用程序。它从SqlServer中获取了115,000个(帐户名称)项目,并且数据绑定到了一个

单个Access 97 ComboBox控件。我的C#版本需要像

这样工作。我们的高级管理人员希望能够从Access 97应用程序中选择整个

组合中的115,000个项目。他们更喜欢

不使用过滤器用较少的项目填充ComboBox,因为它需要采取额外的步骤,减慢生产费用。


我尝试使用C#.NET:目前,我可以将115,000个对象数据绑定到

ComboBox,因为你已经猜到它需要至少一两分钟。 >
来完成这个过程。


现在该怎么办?:是异步数据绑定吗?可能?我看到大量关于异步编程的文章,包括进度条报告,但是这些文章没有解释如何使用数据绑定到图片中

速度加载时间。或者甚至不是它的工作方式...


我可以选择让这些115,000个项目在几秒钟内填充

ComboBox它在Access 97程序中呢?

有人甚至都知道为什么它在Access 97中如此快速地进行数据绑定但是速度很慢

..NET?


任何帮助表示赞赏。在此先感谢。


RR

Hi,

Problem: How can I databind (or put) a SqlServer query''s row return of
115,000 items into a ComboBox quickly? Not much longer than a matter of
seconds, that is...

Scenario: I am rebuilding my company''s Access 97 VBA database app. It pulls
115,000 items (of account names) from SqlServer and the data is bound to a
single Access 97 ComboBox control. My C# version needs to work exactly like
this one. Our executive employees want to be able to select from the entire
list of 115,000 items in the Combo as it is in Access 97 app. They prefer
not to use filters to populate the ComboBox with less items as it "slows"
down their production by having to take extra steps.

My attempt using C#.NET: Currently, I can databind the 115,000 objects to
the ComboBox and as you can already guess it takes at least a minute or two
to finish the process.

What to do now?: Is "asynchronous databinding" possible? I see tons of
articles on asynchronous programming including progressbar reporting however
none of these articles explain how to use databinding into the picture to
speed up load times. Or is that not even how it works...

What are my alternatives to getting these 115,000 items to populate the
ComboBox in a matter of seconds as it does in the Access 97 program? Does
anyone even know why it''s so quick to databind in Access 97 but so slow in
..NET?

Any help is appreciated. Thanks in advance.

RR

推荐答案

不确定它是否适用于ComboBox,但是更多类似的控件(例如

网格),VirtualMode是一个选项。


对于ComboBox,也许一个AutoComplete源可能更多

用户友好而不是庞大的列表?


Marc
Not sure it applies to ComboBox, but more similar controls (such as
grids), VirtualMode is an option.

For ComboBox, perhaps an AutoComplete source might be more
user-friendly than a mammoth list?

Marc


您是否尝试过使用BeginUpdate()和EndUpdate()?我不确定这些工作

是否有数据绑定的组合框。


您是否尝试过手动将项目添加到组合框中?以下

代码在我的笔记本电脑上执行约5秒:


comboBox1.BeginUpdate();

试试

{

comboBox1.Items.Clear();

for(int i = 1; i< 115000; i ++)

comboBox1.Items.Add(i.ToString());

}

终于

{

comboBox1.EndUpdate();

}


" R Reyes" < RR **** @ discuss.microsoft.com写信息

新闻:2D ************************ ********** @ microsof t.com ...
Have you tried using BeginUpdate() and EndUpdate()? I''m not sure these work
with data-bound combo boxes.

Have you tried adding the items to the combo box manually? The following
code executed in about 5 seconds on my laptop:

comboBox1.BeginUpdate();
try
{
comboBox1.Items.Clear();
for (int i = 1; i < 115000; i++)
comboBox1.Items.Add(i.ToString());
}
finally
{
comboBox1.EndUpdate();
}


"R Reyes" <RR****@discussions.microsoft.comwrote in message
news:2D**********************************@microsof t.com...




问题:我怎样才能快速将一个SqlServer查询'

115,000项的行返回数据绑定(或放入)到一个ComboBox中?没有比

秒更长的时间,那就是...


场景:我正在重建我公司的Access 97 VBA数据库应用程序。它从BqlServer中拉出

来自
115,000项(帐户名)并且数据绑定到

单个Access 97 ComboBox控件。我的C#版本需要正好工作

就像

这个。我们的高管员工希望能够从Access 97应用程序中选择组合中115,000项的

整个

列表。他们更喜欢

不使用过滤器用较少的项目填充ComboBox,因为它需要采取额外的步骤,减慢生产费用。


我尝试使用C#.NET:目前,我可以将115,000个对象数据绑定到

ComboBox,因为你已经猜到它需要至少一分钟或

两个

来完成这个过程。


现在该怎么办?:是异步数据绑定吗?可能?我看到大量关于异步编程的b / b
文章,包括进度条报告

然而

这些文章中没有一篇解释如何使用数据绑定到图片中

加快加载时间。或者甚至不是它的工作方式...


我可以选择让这些115,000个项目在几秒钟内填充

ComboBox它在Access 97程序中呢?

有人甚至知道为什么它在Access 97中如此快速地进行数据绑定但是如此之慢

.NET?


感谢任何帮助。在此先感谢。


RR
Hi,

Problem: How can I databind (or put) a SqlServer query''s row return of
115,000 items into a ComboBox quickly? Not much longer than a matter of
seconds, that is...

Scenario: I am rebuilding my company''s Access 97 VBA database app. It
pulls
115,000 items (of account names) from SqlServer and the data is bound to a
single Access 97 ComboBox control. My C# version needs to work exactly
like
this one. Our executive employees want to be able to select from the
entire
list of 115,000 items in the Combo as it is in Access 97 app. They prefer
not to use filters to populate the ComboBox with less items as it "slows"
down their production by having to take extra steps.

My attempt using C#.NET: Currently, I can databind the 115,000 objects to
the ComboBox and as you can already guess it takes at least a minute or
two
to finish the process.

What to do now?: Is "asynchronous databinding" possible? I see tons of
articles on asynchronous programming including progressbar reporting
however
none of these articles explain how to use databinding into the picture to
speed up load times. Or is that not even how it works...

What are my alternatives to getting these 115,000 items to populate the
ComboBox in a matter of seconds as it does in the Access 97 program? Does
anyone even know why it''s so quick to databind in Access 97 but so slow in
.NET?

Any help is appreciated. Thanks in advance.

RR


有趣 - 我不认为for循环会起作用这么快。我会给你一个机会,让你知道它是怎么回事。


谢谢你,Scott。


Scott Roberts写道:
Interesting - I wouldn''t have thought a for loop would work so quickly. I
will give this a shot and let you know how it went.

Thank you, Scott.

"Scott Roberts" wrote:

您是否尝试过使用BeginUpdate()和EndUpdate()?我不确定这些工作

是否有数据绑定的组合框。


您是否尝试过手动将项目添加到组合框中?以下

代码在我的笔记本电脑上执行约5秒:


comboBox1.BeginUpdate();

试试

{

comboBox1.Items.Clear();

for(int i = 1; i< 115000; i ++)

comboBox1.Items.Add(i.ToString());

}

终于

{

comboBox1.EndUpdate();

}


" R Reyes" < RR **** @ discuss.microsoft.com写信息

新闻:2D ************************ ********** @ microsof t.com ...
Have you tried using BeginUpdate() and EndUpdate()? I''m not sure these work
with data-bound combo boxes.

Have you tried adding the items to the combo box manually? The following
code executed in about 5 seconds on my laptop:

comboBox1.BeginUpdate();
try
{
comboBox1.Items.Clear();
for (int i = 1; i < 115000; i++)
comboBox1.Items.Add(i.ToString());
}
finally
{
comboBox1.EndUpdate();
}


"R Reyes" <RR****@discussions.microsoft.comwrote in message
news:2D**********************************@microsof t.com...




问题:我怎样才能快速将一个SqlServer查询'

115,000项的行返回数据绑定(或放入)到一个ComboBox中?没有比

秒更长的时间,那就是...


场景:我正在重建我公司的Access 97 VBA数据库应用程序。它从BqlServer中拉出

来自
115,000项(帐户名)并且数据绑定到

单个Access 97 ComboBox控件。我的C#版本需要正好工作

就像

这个。我们的高管员工希望能够从Access 97应用程序中选择组合中115,000项的

整个

列表。他们更喜欢

不使用过滤器用较少的项目填充ComboBox,因为它需要采取额外的步骤,减慢生产费用。


我尝试使用C#.NET:目前,我可以将115,000个对象数据绑定到

ComboBox,因为你已经猜到它需要至少一分钟或

两个

来完成这个过程。


现在该怎么办?:是异步数据绑定吗?可能?我看到大量关于异步编程的b / b
文章,包括进度条报告

然而

这些文章中没有一篇解释如何使用数据绑定到图片中

加快加载时间。或者甚至不是它的工作方式...


我可以选择让这些115,000个项目在几秒钟内填充

ComboBox它在Access 97程序中呢?

有人甚至知道为什么它在Access 97中如此快速地进行数据绑定但是如此之慢

.NET?


感谢任何帮助。在此先感谢。


RR
Hi,

Problem: How can I databind (or put) a SqlServer query''s row return of
115,000 items into a ComboBox quickly? Not much longer than a matter of
seconds, that is...

Scenario: I am rebuilding my company''s Access 97 VBA database app. It
pulls
115,000 items (of account names) from SqlServer and the data is bound to a
single Access 97 ComboBox control. My C# version needs to work exactly
like
this one. Our executive employees want to be able to select from the
entire
list of 115,000 items in the Combo as it is in Access 97 app. They prefer
not to use filters to populate the ComboBox with less items as it "slows"
down their production by having to take extra steps.

My attempt using C#.NET: Currently, I can databind the 115,000 objects to
the ComboBox and as you can already guess it takes at least a minute or
two
to finish the process.

What to do now?: Is "asynchronous databinding" possible? I see tons of
articles on asynchronous programming including progressbar reporting
however
none of these articles explain how to use databinding into the picture to
speed up load times. Or is that not even how it works...

What are my alternatives to getting these 115,000 items to populate the
ComboBox in a matter of seconds as it does in the Access 97 program? Does
anyone even know why it''s so quick to databind in Access 97 but so slow in
.NET?

Any help is appreciated. Thanks in advance.

RR



这篇关于100K项数据绑定:异步数据绑定是否可行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆