Sql DataAdapters

G

Guest

Hi All,

On my webform in ASP.net I have dragged 4 SqlDataAdapters and have dropped
them to webform. I was wondering what is the norm for how many
SqlDataAdapters should be used in a webform? Is it better to code behind the
SqlDataAdapters instead of using the data controls on the webform generate it
for me? Will I experience a performance hit for using 4 SqlDataAdapters?

Also what is the pros and cons to using a Strong Typed Dataset over a
generic one in code behind?

Thanks,

JJ
 
G

Guest

First question:
Yes, you will have less perf with four data adapters. It is a classic
trade-off: maintainability (drag and drop - ability in this case) versus
performance. You will probably not experience enough perf loss to be a real
concern, however.

A way around this is to create a single sproc that returns all of your data
in the form of four select statements. The downside is you will have to hand
code the update logic, if the data can be manipulated in your form.

Second question:
Strongly typed DataSets perform better, as all of the data is of the correct
type. They are not as forgiving (a con?) and require you to use explicit
coding techniques (I do not personally see this as a con). Because of this,
you should test thoroughly (but, then, you should always be thorough in
testing); if you do not, things WILL blow up on you.

One great benefit of strongly typed DataSets is the dotted notation. The
ability to pull values from a row without thought (the first row in this
instance) is wonderful:

int MemberID = MemberData.Member[0].MemberID;

The biggest beef with developers I have come in contact with is you cannot
be as sloppy with Strongly Typed DataSets as you can with the standard drag
and drop in Visual Studio .NET. I do not see this as a down side. Your
mileage may vary.

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

***************************
Think Outside the Box!
***************************
 
G

Guest

Hi Greg,

See my problem is that I have acouple of lookup tables that populate a few
controls on the webform then I have two tables that are separate as far as
logic is concerned in populating other controls. Besides inline SQL coding is
a no no in the programming world. So I would have to create 4 sqldataadapters
in code behind and wire them up to there respective sp's anyway. I haven't
found a clean way of using one sqldataadapter using drag and drop to access
different sp's. Maybe can use one in code behind without drag and drop then
assign different sp's when needed that way? What do you think? If the 4
sqldataadapters is too much using drag and drop, whats it purpose then?

Thanks,

JJ


Cowboy (Gregory A. Beamer) - MVP said:
First question:
Yes, you will have less perf with four data adapters. It is a classic
trade-off: maintainability (drag and drop - ability in this case) versus
performance. You will probably not experience enough perf loss to be a real
concern, however.

A way around this is to create a single sproc that returns all of your data
in the form of four select statements. The downside is you will have to hand
code the update logic, if the data can be manipulated in your form.

Second question:
Strongly typed DataSets perform better, as all of the data is of the correct
type. They are not as forgiving (a con?) and require you to use explicit
coding techniques (I do not personally see this as a con). Because of this,
you should test thoroughly (but, then, you should always be thorough in
testing); if you do not, things WILL blow up on you.

One great benefit of strongly typed DataSets is the dotted notation. The
ability to pull values from a row without thought (the first row in this
instance) is wonderful:

int MemberID = MemberData.Member[0].MemberID;

The biggest beef with developers I have come in contact with is you cannot
be as sloppy with Strongly Typed DataSets as you can with the standard drag
and drop in Visual Studio .NET. I do not see this as a down side. Your
mileage may vary.

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

***************************
Think Outside the Box!
***************************


JJ said:
Hi All,

On my webform in ASP.net I have dragged 4 SqlDataAdapters and have dropped
them to webform. I was wondering what is the norm for how many
SqlDataAdapters should be used in a webform? Is it better to code behind the
SqlDataAdapters instead of using the data controls on the webform generate it
for me? Will I experience a performance hit for using 4 SqlDataAdapters?

Also what is the pros and cons to using a Strong Typed Dataset over a
generic one in code behind?

Thanks,

JJ
 

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,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top