473,396 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Best Method to return data from a DAL

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
Nov 18 '05 #1
4 1856
Use a Dataset.
They were made for this kind of thing.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"C Downey" <co**************@homtail.com> wrote in message
news:OC**************@TK2MSFTNGP10.phx.gbl...
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

Nov 18 '05 #2
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!
************************************************** ********************
"C Downey" <co**************@homtail.com> wrote in message
news:OC**************@TK2MSFTNGP10.phx.gbl...
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

Nov 18 '05 #3
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

"C Downey" <co**************@homtail.com> wrote in message
news:OC**************@TK2MSFTNGP10.phx.gbl...
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

Nov 18 '05 #4
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

"C Downey" <co**************@homtail.com> wrote in message
news:OC**************@TK2MSFTNGP10.phx.gbl...
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

Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Joe Bloggs | last post by:
I have a general question on best practice regarding data access. I have the code below, a static method defined in a class that I use in a data layer dll. The method takes a string as its...
0
by: Anonieko Ramos | last post by:
ASP.NET Forms Authentication Best Practices Dr. Dobb's Journal February 2004 Protecting user information is critical By Douglas Reilly Douglas is the author of Designing Microsoft ASP.NET...
15
by: Andrew Brampton | last post by:
Hi, This may sound a odd question, but I wanted to know how you return a list of data from a function. These are some of the ways I know how, and I was wondering which method you normally use....
4
by: Arthur Pemberton | last post by:
What is the best way to do data source abtraction? For example have different classes with the same interface, but different implementations. I was thinking of almost having classA as my main...
5
by: Tom | last post by:
If I have a container class that has a map member which stores pointers to objects that have been created via the new operator and I have a method that returns a entry in the map, would it be best...
24
by: Earl | last post by:
I have all of my data operations in a separate library, so I'm looking for what might be termed "best practices" on a return type from those classes. For example, let's say I send an update from...
7
by: Steve | last post by:
I am building an object library for tables in a database. What is the best practice for creating objects like this? For example, say I have the following tables in my database: User: - Id -...
1
by: Muchach | last post by:
Hello, Ok so what I've got going on is a form that is populated by pulling info from database then using php do{} to create elements in form. I have a text box in each table row for the user to...
6
by: kamsmartx | last post by:
I'm new to programming and need some help figuring out an algorithm. I need to design some kind of algorithm which will help us define capacity for one of our portfolios....here's the problem...
2
by: Ben Joyce | last post by:
Hi all. I'm confused as to what the best or expected approch is to Web Service design under .Net, mainly with regards to Methods and Parameters. This is a bit awkward to explain so please bear...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.