Best Method to return data from a DAL

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
 
C

Cowboy \(Gregory A. Beamer\)

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!
**********************************************************************
 
S

Shawn B.

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
 
T

Todd Acheson

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,243
Members
46,836
Latest member
login dogas

Latest Threads

Top