Groups | Blog | Home
all groups > dotnet faqs > october 2005 >

dotnet faqs : VB.NET DataAdapter question



Eric A. Johnson
10/17/2005 5:58:27 AM
I'm using ADO style. I have an Access database with four tables that I will
want to do queries on. I will want to do queries on all four tables, at
least individually, and possibly at the same time (using "INNER JOIN"). My
question: Is it better to have four individual DataAdapters, one for each
table, with the DataSet linking to a different one for each query; one
single DataAdapter, that would connect to all four tables at once; or some
kind of combination of the two? Any tips? As you can tell, I'm rather a
newbie at databases.

Thanks,
Eric

Leon Mayne [MVP]
10/17/2005 10:38:08 AM
[quoted text, click to view]

It's best to have just one adapter per query. It doesn't matter how many
tables you are including in your query, it's the job of the database to link
them together, not .NET

CT
10/19/2005 12:00:00 AM
If you only need to query and not update the data, and if you only need
related data from the tables, I don't see any reason why you shouldn't go
with a single DataAdapter and a single result set in a DataSet. The
resultset is obviosuly created using a JOIN in the SQL statement. However,
if you do need to update, I'd go with four different tables in a DataSet

--
Carsten Thomsen
Communities - http://community.integratedsolutions.dk

[quoted text, click to view]

S.M. Altaf [MVP]
10/19/2005 10:57:27 AM
You may also want to consider setting up relations between your tables in
the dataset, but this of course depends upon your requirements.

-Altaf
[MVP-VB]

--------------------------------------------------------------------------------
All that glitters has a high refractive index.
www.mendhak.com


[quoted text, click to view]

AddThis Social Bookmark Button