How to convert a datareader to a dataview

P

Peter Yin

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

Thanks,

Peter
 
K

Kevin Spencer

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.
 
D

David Browne

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
 
P

Peter Yin

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


.
 

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

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top