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
 
Not automatically.
You might create one manually though.
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top