473,795 Members | 2,746 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sql DataAdapters

JJ
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
Nov 19 '05 #1
2 1232
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.Memb er[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" wrote:
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

Nov 19 '05 #2
JJ
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" wrote:
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.Memb er[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" wrote:
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

Nov 19 '05 #3

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

Similar topics

0
1519
by: hillscottc | last post by:
I have two DataAdapters....1)daStandard does a SELECT *, and 2)daDuplicates uses a stored proc which returns only rows with some duplicate data. Problem is, when I butRefresh_Click and I have selected ALL, I am never able to refresh the data to the DUPS subset of data. Every click returns ALL records. If I choose DUPS the first time it works once, but once I do ALL I can no longer get just the DUPS.
3
1392
by: JJ | last post by:
Hi All I have a DataAdapter that I create in a middle data tier. Now if I called that middle data tier class and it creates that DataAdapter that is global in that class does it persist through the life of the App Thanks J
3
1214
by: JJ | last post by:
I was wondering if I have an existing DataAdapter created and I had killed the connection to it. How do I setup a new connection to same DataAdapter without having to resetup the DataAdapter? So reconnect the DataAdapter after a disconnect is what I'm after. Thanks, JJ
0
1109
by: Rob Reckless | last post by:
Could somebody please tell me how to fill a DataAdapter with the contents of a query that has more than 1 table. I'm trying to create the adapter in my Data tier and populate it with data from 6 tables that are related to each other. i then want to output this data to a Data Grid Thank Rob Reckless
2
1358
by: Adam Clauss | last post by:
Alright, as much as I've done CSharp, I've done very little with databases with it. So I'm just kind of messing around with, learning how it works. I am using the ADO.NET adapter provided with MySQL in a very simple web application. I have the connection, data adapter, and typed datasets created. In response to a button submit, I perform the following: accountsDataAdapter.Fill(accountsDS1); Label_Accounts.Text =...
2
1302
by: Vik | last post by:
Is it possible to loop through all dataadapters on page? Thanks
4
1281
by: Jon Maz | last post by:
Hi, I just read the following in an old NG thread: "when you use the adapter with a closed connection it will open it, do your requested database access, and close it immediately. If you use the adapter with an open connection the connection will continue to be open after the adapter is done." My DataLayer makes extensive use of DataAdapters to fill DataSets, and
2
1673
by: JohnT | last post by:
Okay... I'm using VB.net (2003) and I am accessing an MS Access DB file. I have two DataAdapters that I use to search for specific info. The two of them are similar except one is a Date, the other is a String. Currently they both work as I like and I can get my data as I want. What I'm intersted in is seeing HOW I do a Global search for both cases. Here are my two issues: ISSUE 1:
0
1062
by: Tina | last post by:
I converted my project and it runs ok but when I look at that .aspx page there are no dataadapters. I have tried help and msdn search with words like "conversion" "upgrade" " 2003 to 2005" and many others but I can't find any help on general knowledge on how to deal with converted projects. Can anyone point me to the hidden help? Thanks, T
0
986
by: drisso | last post by:
I found it convenient in asp.net 1.1 that you could easily define a dataadapter through a wizard and when the page reloads the initialize component would recreate it for you each time. Now that the initialize component in 2.0 is only called once when the application loads each time a call back is done or the page load is called the dataadapter is null. Is there anyway that I don't have to create the dataadapter manually in the pageload? ...
0
9519
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10436
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10213
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10000
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7538
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6780
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3722
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.