datareader与数据集 [英] datareader vs. dataset

查看:84
本文介绍了datareader与数据集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阅读关于datareader的文章,据说它更加轻薄。然后更快

数据集。由于datareader每次需要时都必须从数据库中获取数据

,因此它获得的数据应该是最新的。然而,对于IbuySpy和Duwamish样本以及大多数(如果不是全部)购物

购物车示例代码我已经看过使用数据集来实现
电子商务网站。因此,datareader需要从数据库中获取数据的行程是一个性能拖累太多,或者使用

数据集是方式实施电子商务网站?保持

信息最新是一个问题,因为数据集是一个

断开连接的数据访问控制?任何拥有实施电子商务网站的人都会给我一些意见,了解哪个数据访问控制更适合用于实现电子商务网站的



谢谢。

I was reading about datareader which is said to be slimmer & faster then
dataset. Since the datareader have to go fetching the dat from the database
every time it need it, the data it gets then should be up to date. However,
both the IbuySpy and Duwamish samples and most, if not all, the shopping
cart sample codes I''ve seen use dataset to implement the opration for
ecommerce sites. So is the trip that the datareader need to go fetch the
data from the database is too much a performance drag or is using the
dataset is "the way" to implement the ecommerce site? Will keeping the
information up-to-date present a problem because the dataset is a
disconnected data access control? Anyone who has implemt ecommerce site
please give me opinion as to which data access control is more suitable to
use to implement an ecommerce site.
Thanks.

推荐答案

" Bihn" <双** @ mailingaway.com>写在

新闻:ug ************** @ TK2MSFTNGP10.phx.gbl:
"Bihn" <bi**@mailingaway.com> wrote in
news:ug**************@TK2MSFTNGP10.phx.gbl:
我正在读的关于数据处理器,据说更苗条&更快
然后数据集。由于数据处理器每次需要时都必须从数据库中获取数据,因此它所获得的数据应该是最新的。然而,IbuySpy和Duwamish样本以及大多数(如果不是全部)购物车示例代码我已经看过使用数据集来实现电子商务网站的操作。因此,
datareader需要从数据库中获取数据的行程是太多的性能阻力还是正在使用数据集是方式。实施
电子商务网站?保持信息最新是否存在问题,因为数据集是一个断开连接的数据访问控制?
任何拥有实施电子商务网站的人请给我意见
哪个数据访问控制更适合用于实现
电子商务网站。谢谢。
I was reading about datareader which is said to be slimmer & faster
then dataset. Since the datareader have to go fetching the dat from
the database every time it need it, the data it gets then should be up
to date. However, both the IbuySpy and Duwamish samples and most, if
not all, the shopping cart sample codes I''ve seen use dataset to
implement the opration for ecommerce sites. So is the trip that the
datareader need to go fetch the data from the database is too much a
performance drag or is using the dataset is "the way" to implement the
ecommerce site? Will keeping the information up-to-date present a
problem because the dataset is a disconnected data access control?
Anyone who has implemt ecommerce site please give me opinion as to
which data access control is more suitable to use to implement an
ecommerce site. Thanks.



数据集的价值在网络环境中有所减少

,因为每次网页加载数据集时都会刷新。我希望
更喜欢使用datareader因为:


1.数据存储器使用更少的内存

2.数据读取器更快


当使用包含大量数据的数据集时,你会感到很尴尬 - 你会把所有服务器的资源都吸收掉。数据集最适合过滤/分类

小数据集。


-

Lucas Tam(RE **** ****@rogers.com)

请删除删除来自回复时的电子邮件地址。
http://成员。 ebay.com/aboutme/coolspot18/


这是一个半真半假的事实。数据集可以缓存,而数据读取器不能,

这会使您对DataSet的关注无效....我会认为

已断开连接,因而缓存,性质为数据集的主要因素是

优于纯数据读取器。在某些情况下(即使在相同的

应用程序中),一种方法比另一种方法更好。换句话说,

问题很难回答,因为它非常情绪化。


至于保持DataSet最新,DataAdapters和DataTable

包含一些相当不错的功能,用于维持状态显示他们的

断开连接的时尚。


两种方法都有很多选择对于大型系统,我强烈建议使用DataSet和DataReader。我刚刚写完了一篇你可能觉得有用的文章:
http://msdn.microsoft.com/asp.net/de...CustEntCls.asp


Karl


-

我的ASP.Net教程
http://www.openmymind.net/ - 新增和改进(是的,弹出窗口令人讨厌)
http://www.openmymind.net/faq.aspx - 非官方的新闻组常见问题解答(更多内容

来了!)

" Lucas Tam" < RE ******** @ rogers.com>在消息中写道

新闻:Xn *************************** @ 127.0.0.1 ...
This is a half truth. DataSets can be cached while data readers can''t,
which nullifies your concern about DataSets....I would consider the
disconnected, and hence cached, nature of datasets the primary factor to
favor them over pure DataReaders. In some situations (even within the same
application) one method is better than the other. In other words the
question is pretty hard to answer since it''s very situational.

As for keeping the DataSet up to date, the DataAdapters and DataTable
contain some pretty nice functionality for maintaining state dispite their
disconnected fashion.

There are a lot of alternatives to both DataSets and DataReaders which I''d
highly recommend for large scale systems. I just finished writing an
article which you might find useful:
http://msdn.microsoft.com/asp.net/de...CustEntCls.asp

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Lucas Tam" <RE********@rogers.com> wrote in message
news:Xn***************************@127.0.0.1...
" Bihn" <双** @ mailingaway.com>在
新闻中写道:ug ************** @ TK2MSFTNGP10.phx.gbl:
"Bihn" <bi**@mailingaway.com> wrote in
news:ug**************@TK2MSFTNGP10.phx.gbl:
我正在读关于datareader的说法变得更苗条了更快
然后数据集。由于数据处理器每次需要时都必须从数据库中获取数据,因此它所获得的数据应该是最新的。然而,IbuySpy和Duwamish样本以及大多数(如果不是全部)购物车示例代码我已经看过使用数据集来实现电子商务网站的操作。因此,
datareader需要从数据库中获取数据的行程是太多的性能阻力还是正在使用数据集是方式。实施
电子商务网站?保持信息最新是否存在问题,因为数据集是一个断开连接的数据访问控制?
任何拥有实施电子商务网站的人请给我意见
哪个数据访问控制更适合用于实现
电子商务网站。谢谢。
I was reading about datareader which is said to be slimmer & faster
then dataset. Since the datareader have to go fetching the dat from
the database every time it need it, the data it gets then should be up
to date. However, both the IbuySpy and Duwamish samples and most, if
not all, the shopping cart sample codes I''ve seen use dataset to
implement the opration for ecommerce sites. So is the trip that the
datareader need to go fetch the data from the database is too much a
performance drag or is using the dataset is "the way" to implement the
ecommerce site? Will keeping the information up-to-date present a
problem because the dataset is a disconnected data access control?
Anyone who has implemt ecommerce site please give me opinion as to
which data access control is more suitable to use to implement an
ecommerce site. Thanks.



数据集的价值在网络环境中有所减少
因为每次网页加载数据集时都会刷新。我希望尽可能使用datareader,因为:

1. Datareaders使用更少的内存
2.数据读取器更快

当使用包含大量数据的数据集 - 你会吮吸所有服务器的资源。数据集最适合过滤/分类
小数据集。

- Lucas Tam(RE ******** @ rogers.com)请删除删除来自回复时的电子邮件地址。
http://成员。电子通讯网站中的ebay.com/aboutme/coolspot18/


The value of a dataset is somewhat diminished in a web environment
because each time the webpage loads the dataset is refreshed anyways. I
prefer to use a datareader whenever possible because:

1. Datareaders use a lot less memory
2. Data readers are faster

Becareful when using a dataset with a large amount of data - you''ll suck
up all of the server''s resources. Datasets are best for filter/sorting
small sets of data.

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/



出于某些原因应该避免使用数据引导器


1)数据集或数据表的开销,如果单个结果集低于

datareader

2)数据集将保留读锁定时间比一个datareader大多数b / b
除非你非常小心地用

onerror处理包装所有datareader访问来完成关闭你将有资源泄漏。

4)使用数据集更容易编写单元测试

5)通过类型化数据集你可以在编译时捕获编码错误

6)这是一个函数返回datareader的一个非常糟糕的做法,所以它很难正确地构造代码


- 布鲁斯(sqlwork.com)


Lucas Tam < RE ******** @ rogers.com>在消息中写道

news:Xn *************************** @ 127.0.0.1 ...

| " Bihn" <双** @ mailingaway.com>写在

|新闻:ug ************** @ TK2MSFTNGP10.phx.gbl:

|

| >我正在阅读关于datareader的文章,据说它更加轻薄。更快

| >然后是数据集。由于datareader必须从

|获取数据>数据库每次需要它时,它获得的数据应该是up />
| >至今。但是,无论是IbuySpy和Duwamish的样本还是大多数,如果是
| >不是所有的,我见过的购物车示例代码使用数据集

| >实施电子商务网站的操作。那个旅行就是

| > datareader需要从数据库中获取数据太多了。

| >性能拖动或正在使用数据集的是方式。实现

| >电子商务网站?将信息保持最新呈现

| >问题,因为数据集是一个断开连接的数据访问控制?

| >任何拥有实施电子商务网站的人请给我意见

| >哪种数据访问控制更适合用来实现

| >电子商务网站。谢谢。

|

|

|在Web环境中,数据集的值有所减少

|因为每次网页加载数据集都会被刷新。我

|我希望尽可能使用datareader,因为:

|

| 1. Datareaders使用更少的内存

| 2.数据阅读器更快

|

|当使用包含大量数据的数据集时会很糟糕 - 你会吮吸

|所有服务器的资源。数据集最适合过滤/分类

|小数据集。

|

| -

| Lucas Tam(RE********@rogers.com)

|请删除删除回复时从电子邮件地址。

| http://members.ebay.com/aboutme/coolspot18/
in a e-comm sites datareaders should be avoided for serveral reasons

1) the overhead of a dataset or datatable if single result set is low over a
datareader
2) a dataset will hold read locks for less time than a datareader in most
cases
3) unless you are very careful in wrapping all datareader accesses with
onerror handling to do the close you will have a resource leak.
4) unit tests are easier to write with datasets
5) thru typed datasets you can catch coding error ate compile time
6) its a really bad practice for a function to return a datareader, so it
can be hard to properly structure code

-- bruce (sqlwork.com)


"Lucas Tam" <RE********@rogers.com> wrote in message
news:Xn***************************@127.0.0.1...
| "Bihn" <bi**@mailingaway.com> wrote in
| news:ug**************@TK2MSFTNGP10.phx.gbl:
|
| > I was reading about datareader which is said to be slimmer & faster
| > then dataset. Since the datareader have to go fetching the dat from
| > the database every time it need it, the data it gets then should be up
| > to date. However, both the IbuySpy and Duwamish samples and most, if
| > not all, the shopping cart sample codes I''ve seen use dataset to
| > implement the opration for ecommerce sites. So is the trip that the
| > datareader need to go fetch the data from the database is too much a
| > performance drag or is using the dataset is "the way" to implement the
| > ecommerce site? Will keeping the information up-to-date present a
| > problem because the dataset is a disconnected data access control?
| > Anyone who has implemt ecommerce site please give me opinion as to
| > which data access control is more suitable to use to implement an
| > ecommerce site. Thanks.
|
|
| The value of a dataset is somewhat diminished in a web environment
| because each time the webpage loads the dataset is refreshed anyways. I
| prefer to use a datareader whenever possible because:
|
| 1. Datareaders use a lot less memory
| 2. Data readers are faster
|
| Becareful when using a dataset with a large amount of data - you''ll suck
| up all of the server''s resources. Datasets are best for filter/sorting
| small sets of data.
|
| --
| Lucas Tam (RE********@rogers.com)
| Please delete "REMOVE" from the e-mail address when replying.
| http://members.ebay.com/aboutme/coolspot18/


这篇关于datareader与数据集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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