Create Dataset out of SqlDataReader

  • Thread starter Thread starter Vijay Kerji
  • Start date Start date
V

Vijay Kerji

Hi,

Is it possible to create the DataSet object out of SqlDataReader object?

Thanks.

Vijay K Kerji
 
Yes you can,

SqlDataReader myReader = myCommand.ExecuteReader();
myDataSet.DataSource = myReader;
myDataSet.DataBind();

By the way in the DataGridItem.DataItem will return DbDataRecord object a
instead of a DataRowView object. This information may be useful to you if
you use the ItemDataBound and ItemCreated event handlers.

Hope this help,

Francois.
 
Back
Top