D
Daniel
Hi, I'm new to this .Net stuff but am learning as well as I can.
It looks as though there are 2 basic ways to return data from the Data
Access Layer (DAL) to the Business Logic Layer (BLL). One is through the
DataSet class as disconnected cached data. And the other way is through the
DataReader class. The MSDN articles and other sources that I have been
reading recommended not using the DataSet method due to its high overhead
and resource requirement, particulary in web projects where data will need
to be reloaded on virtually every page request. So that option looks like
a poor choice. The DataReader method seems to work fine with 1 exception.
The DataReader object needs to keep the database connection open in order to
use its read function to move through the query results. This seems like a
significant draw back because no other actions can be done to that
connection until the DataReader's close method is called. Which means that
the connection cannot be closed and released back into the pool. Is there
any other way to return query results to the BLL?
Also, if a stored procedure returns both query results and an output
parameter, the output parameter is not available until the DataReader's
close method is called. But, there is apparently no way to reopen the
DataReader after it is closed. How should this be accomplished?
I'm starting to miss disconnected recordsets.
Thanks in advance for any help you provide.
It looks as though there are 2 basic ways to return data from the Data
Access Layer (DAL) to the Business Logic Layer (BLL). One is through the
DataSet class as disconnected cached data. And the other way is through the
DataReader class. The MSDN articles and other sources that I have been
reading recommended not using the DataSet method due to its high overhead
and resource requirement, particulary in web projects where data will need
to be reloaded on virtually every page request. So that option looks like
a poor choice. The DataReader method seems to work fine with 1 exception.
The DataReader object needs to keep the database connection open in order to
use its read function to move through the query results. This seems like a
significant draw back because no other actions can be done to that
connection until the DataReader's close method is called. Which means that
the connection cannot be closed and released back into the pool. Is there
any other way to return query results to the BLL?
Also, if a stored procedure returns both query results and an output
parameter, the output parameter is not available until the DataReader's
close method is called. But, there is apparently no way to reopen the
DataReader after it is closed. How should this be accomplished?
I'm starting to miss disconnected recordsets.
Thanks in advance for any help you provide.