English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

How to bind gridview to datareader in asp.net 2?

2006-12-02 22:10:04 · 1 answers · asked by wael_kabil 1 in Computers & Internet Programming & Design

1 answers

You really wouldn't want to use a datareader at all for grid binding, since it is the wrong kind of connection - you don't want a record-at-a-time real time reader for a rendered control. Use a DataTable (fill it with a SqlDataAdapter or an OleDbDataAdapter.)

Then attach it by declaring the DataTable the .DataSource of the gridview and calling Page.DataBind()

2006-12-03 00:19:40 · answer #1 · answered by evolver 6 · 0 0

fedest.com, questions and answers