与DataReader和DataSet绑定 [英] Binding With DataReader vs DataSet

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

问题描述

使用datareader或数据集绑定Gridview,哪一个更好?

Binding Gridview with datareader or dataset, Which one is better?

推荐答案

将大量数据绑定到数据网格将花费更多时间,以避免时间延迟绑定大量数据我们可以使用DataReader而不是DataSet或DataTable.By默认,Datareader与DataSet或DataTable比较快。
Binding a large amount of data to a datagrid will take more time , to avoid the time delay of binding large amount of data we can use DataReader instead of DataSet or DataTable.By Default , Datareader is fast compared to DataSet or DataTable.


hi

使用DataSet作为你可以直接将它绑定到gridview并可以将其转换为表或默认视图一个重要的是,与datareader相比,它是断开连接的体系结构源。
hi
Use DataSet as u can directly bind that to the gridview and can convert it into table,or default view One Important thing is that it is disconnected source of architecture as compared to datareader.


它取决于你的需要。一个是连接的架构,另一个是断开连接的架构。最简单的规则是,如果要在页面生命周期内反复使用(选择,插入,更新,删除)相同的数据,则转到数据集其他数据读取器。还有很多其他要点取决于单独的文章的情况。浏览MSDN,您将有机会获得其他专家的答案。
It Depends of your need. One is a connected architecture and another one is disconnected architecture. The simplest rule is if you want to use (Select, insert, update, delete) the same data again and again in within the page lifecycle then go for dataset else data reader. There are lot of other points depends on situation that will come a separate article. Browse MSDN and also you will get chance of other experts answers.


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

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