为什么在数据集执行相同操作时使用datatable。 [英] why to use datatable when dataset is doing the same thing.

查看:103
本文介绍了为什么在数据集执行相同操作时使用datatable。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是,当我们拥有提供相同功能(如datatable)的数据集时,为什么我们使用数据表。它的功能也非常庞大(数据集)。我们可以将数据集绑定到gridview,而不是使用数据表的原因。我们还说datatable,dataset,datareader代表一个内存数据库,所以它意味着数据库表存储在我们的pc(物理光盘)中。如果我们的电脑上没有sql server并且使用从物理存储数据库发送表(比如说4)的应用程序(web)而不是表存储的格式怎么办。

解决方案

DataSet DataTable 的集合,所以它们不是一回事。



是的,您可以在客户端使用 DataSet 作为内存数据库,但它是:

*不是多用户

*加载缓慢

*可以记忆占用


参考这些链接



数据集和数据表之间的差异 [ ^ ]



DataTable和DataSet有什么区别? [ ^ ]



DataSets,DataTables和DataViews [ ^ ]



问候..:)


DataSet可以容纳多个DataTable以及它们之间的关系 - 如果需要,可以使用DataSet;如果你不需要,你不需要DataSet。



代表一个内存数据库 - 我从来不需要它。



我很少使用DataSet,它们对我的工作太重了。我有时会使用DataTables,但DataReader会相当多。



你也可以将DataTable绑定到DataGridView和其他控件。


My question is why do we use datatable when we have dataset which provides same functionality like datatable . Also its functionality is very vast(dataset). we can bind dataset to gridview than why to use datatable. Also we say that datatable,dataset,datareader represents an inmemory database so does it mean that that database tables store in our pc (physical disc) . What if we dont have sql server on our pc and using an application(web) that sends us tables(say 4)from physical storage database than in what format do the tables store.

解决方案

DataSet is a collection of DataTables, so they are not the same thing.

Yes you can use a DataSet as an in-memory database on your clients, however it is :
* not multiuser
* slow on loading
* can be memory hogging


Refer these links

Difference between dataset and data table[^]

What is the difference between DataTable and DataSet?[^]

DataSets, DataTables, and DataViews[^]

Regards..:)


DataSets can hold several DataTables and also the relationships between them -- if you need that, you need a DataSet; if you don't need that, you don't need a DataSet.

"represents an inmemory database" -- I never need that.

I very rarely use a DataSet, they are too heavy for what I do. I use DataTables sometimes, but DataReaders quite a bit.

And you can bind a DataTable to a DataGridView and other controls as well.


这篇关于为什么在数据集执行相同操作时使用datatable。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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