How to convert a datareader to a dataview

  • Thread starter Thread starter Peter Yin
  • Start date Start date
P

Peter Yin

Hi All,
Which way is the best way to convert a datareader to a
dataview?

Thanks,

Peter
 
A DataView is a property of a DataTable. You can either read the contents of
your DataReader into a DataTable, or use a DataSet or DataTable initially,
rather than a DataReader.

--
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
Peter Yin said:
Hi All,
Which way is the best way to convert a datareader to a
dataview?

You can't, once you have the DataReader, it's too late.

You need to use a DataAdapter intead, and fill a DataTable. Then build a
DataView from the DataTable.

DataCommand > DataAdapter > DataTable > DataView.

David
 
I see. Thanks a lot you guys.
Peter
-----Original Message-----



You can't, once you have the DataReader, it's too late.

You need to use a DataAdapter intead, and fill a DataTable. Then build a
DataView from the DataTable.

DataCommand > DataAdapter > DataTable > DataView.

David


.
 
Back
Top