Best Method to return data from a DAL

  • Thread starter Thread starter C Downey
  • Start date Start date
C

C Downey

I am creating a data access layer and I'm interested in the best method of
returning data to my business tier.
My database is SQL Server 2000, and I use stored proc's.

Is it better for me to use a dataReader to get the data from the SQL server,
then load it into an arrayList and return the arrayList to my business layer
or should I use the dataset and just return that object from DAL to my
business layer.

The reason I would either use an arrayList or a dataset is that they are
easily bound to controls. Are there other, better methods?

Any advice would be greatly appreciated.

Thanks
 
DataSet is a better option, especially if you are going to migrate to
ASP.NET 2.0 when Visual Studio .NET 2004 comes out.

Here is an architecture webcast that can help:
http://www.microsoft.com/usa/webcasts/ondemand/2391.asp

While I am not sure the architecture fits every app, it is easy to send
junior developers to ... to understand how you architected the solution. His
business objects layers derive from DataSet and add some features that are
highly maintainable without losing a lot of performance. Paul Sherriff
provides the code samples on his site: www.pdsa.com.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

**********************************************************************
Think Outside the Box!
**********************************************************************
 
I use DataTable and if necessary, DataSet. They can be bound more easily to
controls. DataSets have intrinsic functionality to convert to XML and vice
Versa. I try to avoid Readers unless necessary, they have been the source
of an evil in our project (mostly due to misuse) but since we migrated to
DataTables for single resultset results, we've been fine.


Thanks,
Shawn
 
DataSets and DataTables can be resource hogs.

You'll have to weigh the pros and cons of your own situation.
The following may provide insight or be of interest to you.

http://www.ilmservice.com/twincitiesnet/codezone.aspx
The topic to view is called "Creating Custom Collections (Throw Away that
Dataset)"

That's how we do it.
Just one geeks opinion.

-Todd
 
Back
Top