本文介绍了我正在用ado.net编写程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用sqlcommand类和datareader类在面向连接的模型中的网格视图中显示表的所有数据.当datareader一次读取一条记录时,怎么可能呢?

i want to display all data of the table in gridview in connection oriented model using sqlcommand class and datareader class.how it is possible as datareader reads one record at a time?

推荐答案

GridView1.DataSource = reader;
     GridView1.DataBind();



检查此

http://www.java2s.com/Code/ASP/ADO.net-Database/BindSqlDataReadertoGridView.htm [^ ]

http://forums.asp.net/t/1086949.aspx/1 [ ^ ]



Check this

http://www.java2s.com/Code/ASP/ADO.net-Database/BindSqlDataReadertoGridView.htm[^]

http://forums.asp.net/t/1086949.aspx/1[^]



这篇关于我正在用ado.net编写程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 23:04