473,405 Members | 2,167 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,405 software developers and data experts.

Is it recommended to use datasets in ASP.Net ?

Is it recommended to use datasets in ASP.Net 2.0 / VS.Net 2005 ?

Best Regards,

Luqman


Mar 27 '06 #1
16 1907
Hello Luqman,

if you are interested in -just- reading data from whatever database,
you might want to take a look at the 'datareader', as it is more
effecient than the dataset.
Ofcourse if you wish to CRUD with data a dataset will do just fine.
also, you might want to take a look at the new datasource controls
available in asp.net 2.0, these too can do alot of work for you.

Egu

Mar 27 '06 #2
Only if you need them.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Show me your certification without works,
and I'll show my certification
*by* my works.

"Luqman" <pe*******@cyber.net.pk> wrote in message
news:eO**************@tk2msftngp13.phx.gbl...
Is it recommended to use datasets in ASP.Net 2.0 / VS.Net 2005 ?

Best Regards,

Luqman


Mar 27 '06 #3
Datasets are principal building blocks for business logic in dotnet.
Consider using them in all cases where you care about business logic.

Eliyahu

"Luqman" <pe*******@cyber.net.pk> wrote in message
news:eO**************@tk2msftngp13.phx.gbl...
Is it recommended to use datasets in ASP.Net 2.0 / VS.Net 2005 ?

Best Regards,

Luqman


Mar 27 '06 #4
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:Or**************@TK2MSFTNGP12.phx.gbl...
Only if you need them.


:-)
Mar 27 '06 #5
"Luqman" <pe*******@cyber.net.pk> wrote in message
news:eO**************@tk2msftngp13.phx.gbl...
Is it recommended to use datasets in ASP.Net 2.0 / VS.Net 2005 ?


Yes, particularly if you're working with databases... ;-)
Mar 27 '06 #6
objects and classes are the principal building blocks for business logic in
..NET. A DataSet is merely an existing generic container for this - one that
many would say it's drawbacks far outweigh it's
benefits.

Karl
--
http://www.openmymind.net/
http://www.fuelindustries.com/
"Eliyahu Goldin" <re*************@monarchmed.com> wrote in message
news:OE**************@TK2MSFTNGP09.phx.gbl...
Datasets are principal building blocks for business logic in dotnet.
Consider using them in all cases where you care about business logic.

Eliyahu

"Luqman" <pe*******@cyber.net.pk> wrote in message
news:eO**************@tk2msftngp13.phx.gbl...
Is it recommended to use datasets in ASP.Net 2.0 / VS.Net 2005 ?

Best Regards,

Luqman



Mar 27 '06 #7
I disagree. datasets are bloated and break from traditional OO practices.
It's possible to build a solid domain layer around datasets, but requires
extra discipline and care.

It's an ongoing debate which developers should familiarize themeselves with
deeply:
http://msdn.microsoft.com/library/de...CustEntCls.asp

http://scottonwriting.net/sowblog/posts/3867.aspx

Karl
--
http://www.openmymind.net/
http://www.fuelindustries.com/
"Mark Rae" <ma**@markN-O-S-P-A-M.co.uk> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
"Luqman" <pe*******@cyber.net.pk> wrote in message
news:eO**************@tk2msftngp13.phx.gbl...
Is it recommended to use datasets in ASP.Net 2.0 / VS.Net 2005 ?


Yes, particularly if you're working with databases... ;-)

Mar 27 '06 #8
From my point of view,

when your business logic layer is very thin and you just need to forward
insert, update and select operations to the datalayer then you can use
datasets (typed or not but I like to put all my typed dataset in another
layer which I call commonlayer), of course if your application requires a
more complex business logic it could happen that dataset are not enough so
you can still use them for data transfers, but probably you will need
objects (class definitions) to "envelope" your process logic...

anyway you can heaven inherit from dataset and add your own methods and
properties...

Davide.
Mar 27 '06 #9
Objects and classes are too general notions. Datasets come with strong
typing and design tools that do good job for you. Again, they are good when
you care about business logic. When you don't, when all you need is just to
provide data to your form, then they are indeed too heavy.

Eliyahu

"Karl Seguin [MVP]" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME
net> wrote in message news:%2****************@TK2MSFTNGP12.phx.gbl...
objects and classes are the principal building blocks for business logic
in .NET. A DataSet is merely an existing generic container for this - one
that many would say it's drawbacks far outweigh it's
benefits.

Karl
--
http://www.openmymind.net/
http://www.fuelindustries.com/
"Eliyahu Goldin" <re*************@monarchmed.com> wrote in message
news:OE**************@TK2MSFTNGP09.phx.gbl...
Datasets are principal building blocks for business logic in dotnet.
Consider using them in all cases where you care about business logic.

Eliyahu

"Luqman" <pe*******@cyber.net.pk> wrote in message
news:eO**************@tk2msftngp13.phx.gbl...
Is it recommended to use datasets in ASP.Net 2.0 / VS.Net 2005 ?

Best Regards,

Luqman




Mar 27 '06 #10
Well, now, I wouldn't say that is set in stone. There are situations where
DataSets are completely appropriate, although I imagine they arise less
often in ASP.Net applications. For example, I'm currently working with a
Windows Forms app that interacts with a half-dozen tables in the same
database. It is a multi-user app, and as it requires navigating among the
tables with a lot of freedom, I'm using a strongly-typed DataSet, a number
of strongly-typed DataTables, BindingSources, and custom controls based on
the DataGridView. For this project, I found DataSets very useful. But I must
also admit that it is the first app I have worked on in which I found them
useful.

IOW, always use the best tool for the job. And of course, the only way to
know the answer to that one is to be familiar with all of the available
tools.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Show me your certification without works,
and I'll show my certification
*by* my works.

"Karl Seguin [MVP]" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME
net> wrote in message news:OL**************@TK2MSFTNGP14.phx.gbl...
I disagree. datasets are bloated and break from traditional OO practices.
It's possible to build a solid domain layer around datasets, but requires
extra discipline and care.

It's an ongoing debate which developers should familiarize themeselves
with deeply:
http://msdn.microsoft.com/library/de...CustEntCls.asp

http://scottonwriting.net/sowblog/posts/3867.aspx

Karl
--
http://www.openmymind.net/
http://www.fuelindustries.com/
"Mark Rae" <ma**@markN-O-S-P-A-M.co.uk> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
"Luqman" <pe*******@cyber.net.pk> wrote in message
news:eO**************@tk2msftngp13.phx.gbl...
Is it recommended to use datasets in ASP.Net 2.0 / VS.Net 2005 ?


Yes, particularly if you're working with databases... ;-)


Mar 27 '06 #11
Thus wrote Eliyahu,
Objects and classes are too general notions. Datasets come with strong
typing and design tools that do good job for you. Again, they are good
when you care about business logic. When you don't, when all you need
is just to provide data to your form, then they are indeed too heavy.


Um... DataSets and *business logic*? Well, if you really like the active
record pattern...
--
Joerg Jooss
ne********@joergjooss.de
Mar 27 '06 #12
Just my 2 cents - I've only used DataSets for the rare case when I want
to grab a chunk of my database complete with relations, usually for
fairly convoluted reports where no immediately intuitive business
object mapping. I think that's happened once so far :)

Other than that, it's been SqlDataReaders and business objects all the
way, and as I start to grok OO I'm becoming more and more of a purist
about separating my data layer from the UI. Most of the drag 'n drool
features of ASP.Net are fine until you come to build something complex,
or anything that's going to take a beating from a volume of users.

If you genuinely care about business logic, put it in a business logic
layer, keep your data layer for retrieving data, and your UI for
displaying and playing with it. All kinds of nice little benefits arise
unexpectedly from well-factored code.

</lecture>

Mar 27 '06 #13
Agreed with everything.

DataSets have extra benefits in WinForms that outweighs a number of the
shortfalls.

It depends on what you are trying to do. And rather than having people
explain to me what they are trying to do, it's better for them to learn the
pros and cons and apply it to their problems :) But since there tends to be
an overwhelming pro-DataSet support in ASP.NET, I like to counter-balance as
strongly as possible :)

Karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:ui**************@TK2MSFTNGP11.phx.gbl...
Well, now, I wouldn't say that is set in stone. There are situations where
DataSets are completely appropriate, although I imagine they arise less
often in ASP.Net applications. For example, I'm currently working with a
Windows Forms app that interacts with a half-dozen tables in the same
database. It is a multi-user app, and as it requires navigating among the
tables with a lot of freedom, I'm using a strongly-typed DataSet, a number
of strongly-typed DataTables, BindingSources, and custom controls based on
the DataGridView. For this project, I found DataSets very useful. But I
must also admit that it is the first app I have worked on in which I found
them useful.

IOW, always use the best tool for the job. And of course, the only way to
know the answer to that one is to be familiar with all of the available
tools.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Show me your certification without works,
and I'll show my certification
*by* my works.

"Karl Seguin [MVP]" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME
net> wrote in message news:OL**************@TK2MSFTNGP14.phx.gbl...
I disagree. datasets are bloated and break from traditional OO practices.
It's possible to build a solid domain layer around datasets, but requires
extra discipline and care.

It's an ongoing debate which developers should familiarize themeselves
with deeply:
http://msdn.microsoft.com/library/de...CustEntCls.asp

http://scottonwriting.net/sowblog/posts/3867.aspx

Karl
--
http://www.openmymind.net/
http://www.fuelindustries.com/
"Mark Rae" <ma**@markN-O-S-P-A-M.co.uk> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
"Luqman" <pe*******@cyber.net.pk> wrote in message
news:eO**************@tk2msftngp13.phx.gbl...

Is it recommended to use datasets in ASP.Net 2.0 / VS.Net 2005 ?

Yes, particularly if you're working with databases... ;-)



Mar 27 '06 #14
It takes time to instantiate and fill a DataSet just to throw it away in a
few milliseconds when the page is done rendering.
Therefore, generally DataReaders are a more efficient solution in ASP.NET.
However, if you need to do some extra fancy data manipulation then there are
times when a DataSet would be a better choice.
One good use for DataSets in ASP.NET is when you need to cache some data.
DataReaders can't really be cached so a DataSet (or better yet a DataTable)
is a good choice in this situation.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

"Luqman" <pe*******@cyber.net.pk> wrote in message
news:eO**************@tk2msftngp13.phx.gbl...
Is it recommended to use datasets in ASP.Net 2.0 / VS.Net 2005 ?

Best Regards,

Luqman


Mar 27 '06 #15
> But since there tends to be an overwhelming pro-DataSet support in
ASP.NET, I like to counter-balance as strongly as possible :)
I'm 100% with you there, Karl. Many people use DataSets because they are
"easier" to use than hand-rolled data code. That is, they have a lot of
built-in functionality, and GUI tools to support them. This is absolutely
the *wrong* reason to use any resource in an application. Requirements alone
should dictate the tools used to write an application.

DataSets are disconnected. This can be useful, and it can also bite one in
the *ss, if one does not plan for it. In an ASP.Net application, caching a
large DataSet can be a memory issue. An ASP.Net application is a
client-server application. Memory and processor must be managed well.

IOW, laziness and ignorance are both inexcusable, as they are both by
choice. In addition, laziness in programming has the ultimate and ironic
effect of causing *more* work over the long haul. It is important to
understand one's motivations for using various tools in the toolset.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Show me your certification without works,
and I'll show my certification
*by* my works.

"Karl Seguin [MVP]" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME
net> wrote in message news:Ox**************@TK2MSFTNGP12.phx.gbl... Agreed with everything.

DataSets have extra benefits in WinForms that outweighs a number of the
shortfalls.

It depends on what you are trying to do. And rather than having people
explain to me what they are trying to do, it's better for them to learn
the pros and cons and apply it to their problems :) But since there tends
to be an overwhelming pro-DataSet support in ASP.NET, I like to
counter-balance as strongly as possible :)

Karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:ui**************@TK2MSFTNGP11.phx.gbl...
Well, now, I wouldn't say that is set in stone. There are situations
where DataSets are completely appropriate, although I imagine they arise
less often in ASP.Net applications. For example, I'm currently working
with a Windows Forms app that interacts with a half-dozen tables in the
same database. It is a multi-user app, and as it requires navigating
among the tables with a lot of freedom, I'm using a strongly-typed
DataSet, a number of strongly-typed DataTables, BindingSources, and
custom controls based on the DataGridView. For this project, I found
DataSets very useful. But I must also admit that it is the first app I
have worked on in which I found them useful.

IOW, always use the best tool for the job. And of course, the only way to
know the answer to that one is to be familiar with all of the available
tools.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Show me your certification without works,
and I'll show my certification
*by* my works.

"Karl Seguin [MVP]" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME
net> wrote in message news:OL**************@TK2MSFTNGP14.phx.gbl...
I disagree. datasets are bloated and break from traditional OO
practices. It's possible to build a solid domain layer around datasets,
but requires extra discipline and care.

It's an ongoing debate which developers should familiarize themeselves
with deeply:
http://msdn.microsoft.com/library/de...CustEntCls.asp

http://scottonwriting.net/sowblog/posts/3867.aspx

Karl
--
http://www.openmymind.net/
http://www.fuelindustries.com/
"Mark Rae" <ma**@markN-O-S-P-A-M.co.uk> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
"Luqman" <pe*******@cyber.net.pk> wrote in message
news:eO**************@tk2msftngp13.phx.gbl...

> Is it recommended to use datasets in ASP.Net 2.0 / VS.Net 2005 ?

Yes, particularly if you're working with databases... ;-)



Mar 28 '06 #16

Steve C. Orr [MVP, MCSD] wrote:
It takes time to instantiate and fill a DataSet just to throw it away in a
few milliseconds when the page is done rendering.
Therefore, generally DataReaders are a more efficient solution in ASP.NET.
However, if you need to do some extra fancy data manipulation then there are
times when a DataSet would be a better choice.
One good use for DataSets in ASP.NET is when you need to cache some data.
DataReaders can't really be cached so a DataSet (or better yet a DataTable)
is a good choice in this situation.
If I can just hijack this thead a bit... I've been meaning to ask for a
while; how well do business objects cache? I've got a few places in the
current app where we keep static chunks of data lying about, sometimes
in custom collections, more commonly in generic dictionaries; but I'm
considering setting up a DAL in a future project where most data will
be cached, quite possibly in an OrderedBag from the PowerCollections
code.

It would mean I could page/sort/filter my strongly typed objects, and
generally do all sorts of wonderful Object Oriented Ajax-y things
without cluttering StoredProc code or gulping thousands of rows for
each postback, but I'm terrified whenever I start thinking about how
much RAM it's going to consume. We've got two managed servers, and more
servers can be added but I'm wondering just how inefficient this is.

Any comments?

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

"Luqman" <pe*******@cyber.net.pk> wrote in message
news:eO**************@tk2msftngp13.phx.gbl...
Is it recommended to use datasets in ASP.Net 2.0 / VS.Net 2005 ?

Best Regards,

Luqman



Mar 28 '06 #17

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

Similar topics

4
by: Alpha | last post by:
I have a small Window application and through out the different forms I create a different dataset. At the begining I used the Tools to drag and drop the SqlDataAdapter, connection and dataset...
9
by: GaryDean | last post by:
We have been noticing that questions on vs.2005/2.0 don't appear to get much in answers so I'm reposting some questions posted by some of the programmers here in our organization that never got...
4
by: Ronald S. Cook | last post by:
I've always used untyped datasets. In a Microsoft course, it walks through creating typed datasets and harps on the benefits. It has you drag all these things around ..wizard, wizard, wizard......
25
by: Penelope Dramas | last post by:
Hello, I'm in a front of very serious .net redesign/rewrite of an old VB6 application. I had been asked to make it .NET 2.0 and would like to ask couple of questions regarding data access as...
2
by: S.Tedeschi | last post by:
Hi all gurus. I'm trying to switch to VS 2005, from VS 2003. I've an ASP.NET 1.1 app heavily relying on StronglyTyped DataSets, with lots of FindByKey..., dataSet.Tablename, and similar methods....
0
by: S.Tedeschi | last post by:
Hi all; as posted some days ago, I'm converting an on-line app; I used to heavily rely on strongly-typed DataSets directly dropped onto pages, and so viewed by code(-behind) as well. In the next...
1
by: Jasbird | last post by:
Is there a recommended book for ASP.NET which avoids DataSets and DataTables in favour of collections and uses code behind to bind data to controls rather than using SqlDataSource and...
12
by: BillE | last post by:
I'm trying to decide if it is better to use typed datasets or business objects, so I would appreciate any thoughts from someone with more experience. When I use a business object to populate a...
9
by: gardnern | last post by:
We have X number of data sets, of Y length each. For example... Small, Medium, Large and Red, Green, Blue, Yellow We need to generate a list of all possibilities Small Red
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.