一旦检索到数据,就从数据库中异步检索数据。 [英] Asynchronously retrieve data from database as soon as its retrieved.

查看:86
本文介绍了一旦检索到数据,就从数据库中异步检索数据。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

场景:

一旦获取记录,就立即将数据(从db)绑定到datagrid(windows窗体,UI)。流式


要求:

例如:查询:从员工中选择*,将返回100,000条记录。因此,只要获取第一条记录,网格就应该开始绑定,显示绑定记录的计数,例如:count:1,count:2 ....依此类推。


问题:

我试过探索像BeginExecuteReader那样的ADO.net功能,但是,这是一种异步获取数据的方法。
b $ b例如:如果有两个网格,一个用于填充员工和其他部门。

在上述情况下,在获取员工数据时,该过程不会等待它完成,并会立即触发部门请求,这是一个根据我的要求,上述不同的场景。


问题:

1)是否可以实现。

2)如果回答第一个是肯定的,那么出去/解决的方式是什么?b $ b 3)如果可能的话,有些人可以分享简单的样本以显示相同的内容。


开发环境:

VS2005

MSSQL2008

windows应用程序,Web服务(智能客户端应用程序) )


即使任何人只能在Windows上给出一个例子也没关系


任何输入都将不胜感激。


谢谢&关于Ajay Singh

解决方案

场景:

立即将数据(从db)绑定到datagrid(windows窗体,UI),一旦提取了记录。流式


要求:

例如:查询:从员工中选择*,将返回100,000条记录。因此,只要获取第一条记录,网格就应该开始绑定,显示绑定记录的计数,例如:count:1,count:2 ....依此类推。


问题:

我试过探索像BeginExecuteReader那样的ADO.net功能,但是,这是一种异步获取数据的方法。
b $ b例如:如果有两个网格,一个用于填充员工和其他部门。

在上述情况下,在获取员工数据时,该过程不会等待它完成,并会立即触发部门请求,这是一个根据我的要求,上述不同的场景。


问题:

1)是否可以实现。

2)如果回答第一个是肯定的,那么出去/解决的方式是什么?b $ b 3)如果可能的话,有些人可以分享简单的样本以显示相同的内容。


开发环境:

VS2005

MSSQL2008

windows应用程序,Web服务(智能客户端应用程序) )


即使任何人只能在Windows上给出一个例子也没关系


任何输入都将不胜感激。


Scenario:
Bind the data(from db) to datagrid(windows form,UI) instantly, as soon as the records are fetched. kind of streaming

Requirement:
e.g: Query: select * from employee, would return 100,000 records. So as soon as the first record is fetched, grid should start binding showing the count of record being bound e.g: count:1, count:2.... and so on.

Issue:
I have tried exploring ADO.net feature like BeginExecuteReader kind of stuff, however, this is a means of fetching data asynchronously.
e.g: if two grids were there, one to populate employee and other department.
In the above case by the time employee data is being fetched, the process would not wait for it to be completed and would immediately fire the request for dept which is a different scene from the one mentioned above for my requirement.

Questions:
1) Can this be achieved.
2) If answere to first is yes, then what is the way out/work around
3) If possible, can some one share simple sample to show the same.

Development Environment:
VS2005
MSSQL2008
windows application , web service (smart client application)

would be fine even if any one could give an example on windows only

Any input will be greatly appreciated.


Thanks & Regards Ajay Singh

解决方案

Scenario:
Bind the data(from db) to datagrid(windows form,UI) instantly, as soon as the records are fetched. kind of streaming

Requirement:
e.g: Query: select * from employee, would return 100,000 records. So as soon as the first record is fetched, grid should start binding showing the count of record being bound e.g: count:1, count:2.... and so on.

Issue:
I have tried exploring ADO.net feature like BeginExecuteReader kind of stuff, however, this is a means of fetching data asynchronously.
e.g: if two grids were there, one to populate employee and other department.
In the above case by the time employee data is being fetched, the process would not wait for it to be completed and would immediately fire the request for dept which is a different scene from the one mentioned above for my requirement.

Questions:
1) Can this be achieved.
2) If answere to first is yes, then what is the way out/work around
3) If possible, can some one share simple sample to show the same.

Development Environment:
VS2005
MSSQL2008
windows application , web service (smart client application)

would be fine even if any one could give an example on windows only

Any input will be greatly appreciated.


这篇关于一旦检索到数据,就从数据库中异步检索数据。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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