Convert DataReader into DataTable

  • Thread starter Thread starter Vinod I
  • Start date Start date
V

Vinod I

Hi Team,

I just want to know whether is it possible to convert the DataReader into
DataTable in a single line.

for eg. objTable = (datatable) objDataReader .

Thanks in advance.
 
Vinod,

Not that I'd do it this way, but if you really want to use just one line of
code,

New SQLDataAdapter(SQLCommand).Fill(objTable)

should work. It will use a DataReader behind the scenes.
 
Back
Top