M
Marinos Christoforou
I have an application which is multi-tiered. I want to return a
sqldatareader object from a function called in the data access tier. I know
that the preferred way of transferring data through tiers is with a dataset
but I want to use a datareader. My question is it possible to do this given
that the datareader object must remain connected to the database, so how
would I code the data access component correctly.
My first attempt failed because my code called the close method of the
sqlconnection object before returning the datareader abject.
However return the datreader from the data access layer without closing the
conncetion doesn't seem right.
sqldatareader object from a function called in the data access tier. I know
that the preferred way of transferring data through tiers is with a dataset
but I want to use a datareader. My question is it possible to do this given
that the datareader object must remain connected to the database, so how
would I code the data access component correctly.
My first attempt failed because my code called the close method of the
sqlconnection object before returning the datareader abject.
However return the datreader from the data access layer without closing the
conncetion doesn't seem right.