DataReader Problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • VIJAY KUMAR

    DataReader Problem

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

  • Chris, Master of All Things Insignificant

    #2
    Re: DataReader Problem

    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



    "VIJAY KUMAR" <VIJAYKUMAR@dis cussions.micros oft.com> wrote in message
    news:D8A95B50-F67B-4B81-B25B-1907CB3750FA@mi crosoft.com...[color=blue]
    > 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......
    >[/color]


    Comment

    Working...