PC Review


Reply
Thread Tools Rate Thread

Proper use of Data Adapters

 
 
JD Kronicz
Guest
Posts: n/a
 
      3rd Oct 2003
I am new to VS.net and I am trying to figure out how to
use data adapters and datasets. It seems that from what I
have read you typically use a data adapter to retrieve a
single table. Then multiple data adapters are used to
fill a single dataset and relations are defined to yield a
hierarchial structure.
I see that you can configure a data adapter to return more
than one table. Why not use a data adapter to return
multiple tables to a dataset instead of a seperate data
adapter for each data table?

I am also trying to figure out when you would use views or
stored procedures in the database as opposed to
constructing these same elements in a dataadapter.

Any thoughts on this topic would be greatly appreciated.
In addtion, any references would also be appreciated.

Thanks - JD
 
Reply With Quote
 
 
 
 
msnews.microsoft.com
Guest
Posts: n/a
 
      3rd Oct 2003
It depends on what you are doing. If you separately update data, using the
built in .NET way, multiple adapters make it easier, as the Adapter Update
method can be fired to save changes.

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

**********************************************************************
Think Outside the Box!
**********************************************************************
"JD Kronicz" <(E-Mail Removed)> wrote in message
news:1f2e601c389c1$55543020$(E-Mail Removed)...
> I am new to VS.net and I am trying to figure out how to
> use data adapters and datasets. It seems that from what I
> have read you typically use a data adapter to retrieve a
> single table. Then multiple data adapters are used to
> fill a single dataset and relations are defined to yield a
> hierarchial structure.
> I see that you can configure a data adapter to return more
> than one table. Why not use a data adapter to return
> multiple tables to a dataset instead of a seperate data
> adapter for each data table?
>
> I am also trying to figure out when you would use views or
> stored procedures in the database as opposed to
> constructing these same elements in a dataadapter.
>
> Any thoughts on this topic would be greatly appreciated.
> In addtion, any references would also be appreciated.
>
> Thanks - JD



 
Reply With Quote
 
 
 
 
William \(Bill\) Vaughn
Guest
Posts: n/a
 
      3rd Oct 2003
Yes, unfortunately the doc (and many examples) implies that you should
retrieve a single table with a DataAdapter (DA). While this is ok for
single-user applications with small tables, this approach falls apart
quickly as the number of user grows (past 1) and the number of rows to
retrieve increases past a few hundred. The DA is designed to work with
rowsets. The naming of the DataTable object is unfortunate--I wish they had
called it the "DataRowset" object instead. Generally, one creates a SELECT
query to return a focused set of rows (for example, all the honest lawyers
in your town) instead of the entire table. If you expect to use the DA
Update method on the rowset, you'll need a separate DA for each. Yes, a
single DataSet can hold many tables and each of the DAs can point to the
same DataSet.

I discuss this in detail in my book.

hth

--
____________________________________
Bill Vaughn
MVP, hRD
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________

"JD Kronicz" <(E-Mail Removed)> wrote in message
news:1f2e601c389c1$55543020$(E-Mail Removed)...
> I am new to VS.net and I am trying to figure out how to
> use data adapters and datasets. It seems that from what I
> have read you typically use a data adapter to retrieve a
> single table. Then multiple data adapters are used to
> fill a single dataset and relations are defined to yield a
> hierarchial structure.
> I see that you can configure a data adapter to return more
> than one table. Why not use a data adapter to return
> multiple tables to a dataset instead of a seperate data
> adapter for each data table?
>
> I am also trying to figure out when you would use views or
> stored procedures in the database as opposed to
> constructing these same elements in a dataadapter.
>
> Any thoughts on this topic would be greatly appreciated.
> In addtion, any references would also be appreciated.
>
> Thanks - JD



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Table adapters vs. Data adapters Chas Microsoft VB .NET 1 23rd May 2007 06:04 AM
Manipulating data between data adapters John Microsoft ADO .NET 3 28th Aug 2006 05:30 PM
Manipulating data between data adapters John Microsoft VB .NET 3 28th Aug 2006 05:30 PM
Non-GUI use of table adapters / data tables... =?Utf-8?B?TWFydHkgQ3J1aXNl?= Microsoft VB .NET 2 11th Oct 2005 08:38 AM
Data Adapters, Data Sets, Data TableMappings, and XML Candi Suriano Microsoft ADO .NET 0 22nd Aug 2003 08:46 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:59 PM.