数据集和数据读取器

编程入门 行业动态 更新时间:2024-10-23 19:32:21
本文介绍了数据集和数据读取器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

哪一个最适合在C#的Web应用程序中使用? DataSet或DataReader

Which one is best to use in web application of C#? Either DataSet or DataReader

推荐答案

DataReader是快进的只有读者,其中DataTable和DataSet代表一个或多个内存数据表。 这取决于您在网络应用中的需求。如果必须缓存数据结果。使用DataTable。 DataReader is a fast-forward only reader, where DataTable and DataSet represents one or more table of in-memory data. It depends on your need in your web app. If you have to cache your data result. The use DataTable.

从这里开始 - Google search - dataset vs datareader [ ^ ]。 Start here - Google search - dataset vs datareader[^].

没有什么比最好了。这完全取决于您的要求。如果您只需要显示某些内容,则没有理由选择DataSet。但是如果你还需要进行更新和插入,你可以使用DataSet。 BTW DataAdapter使用DataReader来填充DataSet尽管它有点无关紧要。 OffTopic:没有任何名为C#.Net。 There is nothing like best. It all depends on what your requirements are. If all you need is to display something, there is no reason to go for a DataSet. But if you need to do updates and inserts as well, you may use DataSet. BTW DataAdapter uses DataReader to populate the DataSet although it is bit irrelevant. OffTopic: There is nothing called C#.Net.

更多推荐

数据集和数据读取器

本文发布于:2023-10-26 09:43:10,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1529787.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:数据   读取器

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!