DataReader Problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

Problem: Return ArrayList where Values are Added using DataReader.

Note: My Data Reader returns M Columns and N Rows

I am using DataReader in Data Access layer. I want to return this result to
Business Layer. But, considering performace and Efficiency, I have to Close
the DataReader Connection.

If I return this Datareader, again I need to open connection in Business
Layer, which is not good.

I tryinh to use ArrayList to return. But as of I know, we cant create Muti
Dimentional Array List

I really appreciate your Help......
 
Is there something wrong with using a DataTable? This is the client side
storage that ADO.NET uses. You could use a DataAdapter and use the fill
command to fill up the datatable for you but you will take on the overhead
of a dataset and you may not need that. Otherwise just iterate through the
datareader and create the datatable on the fly. That's what the dataadapter
would do anyhow.

Chris
 
Back
Top