473,396 Members | 1,893 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,396 software developers and data experts.

Data Adapter Configuration Wizard...

The data adapter wizard allows you to add more than one
table, but that doesn't seem to work right when setting up
a dataset. Some of the documentation I have read states
that only one table should be selected per data adapter,
and then you use a DataRelation object to pull join them
together. Okay, if that's the case then fine, but why
would the data adapter allow you to add more than one
table if this is not how it is supposed to work. If only
one table should be used, then the program should only
allow the addition of one table.

I'm sure I'm missing out on something here, but nothing I
have read explains it. I'm kinda new to vb.net, so I hope
someone can provide an explanation or reference to an
article on this.

Any help would be greatly appreciated.

Thanks,
Rick
Nov 20 '05 #1
5 2426
Rick,
DataSet's are supposed to be able to contain one or more tables
and relations etc, that is why its called a 'Set'. I would recommend that
you dont use the wizards except for things like getting the right connection
strings and parameterised lists etc.

Spend some time looking at how the wizard places the code on the form and
then try to do this manually. You will find that you will learn a lot more
this way and also have much more control over your data.

I would suggest that you go to the adonet newsgroup for more help as there
are specialists operating there who are more likely to spend time answering
detailed questions.

Best Regards - OHM



Rick wrote:
The data adapter wizard allows you to add more than one
table, but that doesn't seem to work right when setting up
a dataset. Some of the documentation I have read states
that only one table should be selected per data adapter,
and then you use a DataRelation object to pull join them
together. Okay, if that's the case then fine, but why
would the data adapter allow you to add more than one
table if this is not how it is supposed to work. If only
one table should be used, then the program should only
allow the addition of one table.

I'm sure I'm missing out on something here, but nothing I
have read explains it. I'm kinda new to vb.net, so I hope
someone can provide an explanation or reference to an
article on this.

Any help would be greatly appreciated.

Thanks,
Rick

Nov 20 '05 #2
Hi,
I appreciate your response, and I could not agree with you
more. I have purchased a couple of books on vb.net, and
I'm going to be doing exactly what you recommended. My
development progression is not based on using this
wizard... I am simply making a point on the principle more
than anything at this point (and in my view the question
applies to whether it's done in code or not). Again, I
appreciate your response very much and I agree with you
100% (and I will follow-up by posting the question in the
ado.net section.

Also, you made the point about a dataset containing more
than one table, but I believe the problem is based in the
adapter... not the dataset. Take the text below that I
put in from an article. Based on this text, it appears
that one adapter (whether in code or otherwise) should be
used per table, and then the dataset pulls in the multiple
tables through muliple adapters... NOT one adapter for
multiple tables.
Data adapters and Related Tables:

"An implication of having separate tables in the dataset
is that a data adapter typically does not reference SQL
Commands or stored procedures that join tables. Instead,
information from the related tables is read separately
into the dataset by different adapters. Then a
DataRelation object is used to manage constraints between
the dataset tables (such as cascading updates) and to
allow you to navigate between related master and child
records."
So again, the point is that while the above makes sense,
it does not answer the question as to why the data adapter
allows for adding multiple tables. The question is just
bothering me more than anything else... I'm not hinging me
development experience on it :o) I'm sure that writing
this in code will enlighten the issue, but it would be
nice to know what the deal is with the adapter anyway.
Thanks a lot!!

-----Original Message-----
Rick,
DataSet's are supposed to be able to contain one or more tablesand relations etc, that is why its called a 'Set'. I would recommend thatyou dont use the wizards except for things like getting the right connectionstrings and parameterised lists etc.

Spend some time looking at how the wizard places the code on the form andthen try to do this manually. You will find that you will learn a lot morethis way and also have much more control over your data.

I would suggest that you go to the adonet newsgroup for more help as thereare specialists operating there who are more likely to spend time answeringdetailed questions.

Best Regards - OHM



Rick wrote:
The data adapter wizard allows you to add more than one
table, but that doesn't seem to work right when setting up a dataset. Some of the documentation I have read states
that only one table should be selected per data adapter,
and then you use a DataRelation object to pull join them
together. Okay, if that's the case then fine, but why
would the data adapter allow you to add more than one
table if this is not how it is supposed to work. If only
one table should be used, then the program should only
allow the addition of one table.

I'm sure I'm missing out on something here, but nothing I have read explains it. I'm kinda new to vb.net, so I hope someone can provide an explanation or reference to an
article on this.

Any help would be greatly appreciated.

Thanks,
Rick

.

Nov 20 '05 #3
Cor
Hi Rick,

Makes this piece of code that I use give you the Idea that the dataadapter
can do more datasets and a datatable more datasets (I deleted some things to
make it more simple but basicly it is the same) ?

Cor
\\\
Public Shared Sub UpdateDataset(ByVal sqlStr As String, ByVal ds As DataSet,
ByVal mDatatable As String)
Dim Conn As New OleDbConnection(connString)
Try
Dim da As New OleDbDataAdapter
Dim cmd As New OleDbCommand(sqlStr, Conn)
da.SelectCommand = cmd
Dim cb As OleDbCommandBuilder = _
New OleDbCommandBuilder(da)
If ds.HasChanges Then
da.Update(ds.GetChanges, mDatatable)
End If
Catch oledbExc As OleDbException
MessageBox.Show(oledbExc.ToString)
Catch ex As Exception
MessageBox.Show(ex.Message)
Finally
Conn.Close()
End Try
End Sub
///
Nov 20 '05 #4
Cor
Error
Makes this piece of code that I use give you the Idea that the dataadapter
can do more datasets and a datatable more datasets


A dataset more datatables
Nov 20 '05 #5
I think to answer you're question, I would simply turn it on its head, "Why
Not?", the approach taken was one of flexibility. One Dataset can have one
or more DataAdapters, One DataAdapter can deliver one or more tables.
Different scenario's demand different approaches.

HTH - OHM

Rick wrote:
Hi,
I appreciate your response, and I could not agree with you
more. I have purchased a couple of books on vb.net, and
I'm going to be doing exactly what you recommended. My
development progression is not based on using this
wizard... I am simply making a point on the principle more
than anything at this point (and in my view the question
applies to whether it's done in code or not). Again, I
appreciate your response very much and I agree with you
100% (and I will follow-up by posting the question in the
ado.net section.

Also, you made the point about a dataset containing more
than one table, but I believe the problem is based in the
adapter... not the dataset. Take the text below that I
put in from an article. Based on this text, it appears
that one adapter (whether in code or otherwise) should be
used per table, and then the dataset pulls in the multiple
tables through muliple adapters... NOT one adapter for
multiple tables.
Data adapters and Related Tables:

"An implication of having separate tables in the dataset
is that a data adapter typically does not reference SQL
Commands or stored procedures that join tables. Instead,
information from the related tables is read separately
into the dataset by different adapters. Then a
DataRelation object is used to manage constraints between
the dataset tables (such as cascading updates) and to
allow you to navigate between related master and child
records."
So again, the point is that while the above makes sense,
it does not answer the question as to why the data adapter
allows for adding multiple tables. The question is just
bothering me more than anything else... I'm not hinging me
development experience on it :o) I'm sure that writing
this in code will enlighten the issue, but it would be
nice to know what the deal is with the adapter anyway.
Thanks a lot!!

-----Original Message-----
Rick,
DataSet's are supposed to be able to contain one or more
tables and relations etc, that is why its called a 'Set'. I would
recommend that you dont use the wizards except for things like
getting the right connection strings and parameterised lists etc.

Spend some time looking at how the wizard places the code on the
form and then try to do this manually. You will find that you will
learn a lot more this way and also have much more control over your
data.

I would suggest that you go to the adonet newsgroup for more help as
there are specialists operating there who are more likely to spend
time answering detailed questions.

Best Regards - OHM



Rick wrote:
The data adapter wizard allows you to add more than one
table, but that doesn't seem to work right when setting up
a dataset. Some of the documentation I have read states
that only one table should be selected per data adapter,
and then you use a DataRelation object to pull join them
together. Okay, if that's the case then fine, but why
would the data adapter allow you to add more than one
table if this is not how it is supposed to work. If only
one table should be used, then the program should only
allow the addition of one table.

I'm sure I'm missing out on something here, but nothing I
have read explains it. I'm kinda new to vb.net, so I hope
someone can provide an explanation or reference to an
article on this.

Any help would be greatly appreciated.

Thanks,
Rick

.

Nov 20 '05 #6

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

Similar topics

0
by: Randy Smith | last post by:
Hi ALL, I have a simple ASPX.Net page where I am trying to add an SQLDataAdapter, and want to use stored SQL procedures with parameters. When I look at the stored procedure in Server Explorer,...
0
by: Vince Campanile | last post by:
Ive got what must bea very basic question, but its got ne thouroughly stumped. Im writing a very simple application in Visual Basic.Ne 2003, thats using a data adapter hooked up to an Access...
3
by: Al Gerharter | last post by:
Hi, I'm building a form, and tying it to a database via SQL connection, SQLdataadapter, and a Dataset. It appears that the data adapter will not let me select more than 100 fields in the SQL...
2
by: M Sameer Haider | last post by:
I am trying to use SQL statement in my Data Adapter Configuration wizard. Can anyone help me to write a query which will selest some field from different tables from a relational database and...
1
by: RBirney | last post by:
I am trying to set the 'select command' in the code rather than have it permanently set. I am using an Oracle data adapter and connection (don't know if this makes a difference) and i have the...
1
by: John | last post by:
Hi When using Table Adapter Configuration Wizard if 'Use SQL Statements' is selected as Command Type, the data table's name in dataset is retained and only its data adapter's select statements...
2
by: Gshell | last post by:
When I get to the "Choose your data connection" screen and click the down arrow by the combo box, it takes several minutes (4 or more) to present my list of two pre-existing sources. (Both of...
1
by: Demetri | last post by:
I have a question / concern regarding the new suggested way of creating a data access layer in an n-tier application. Typically, a web application specifically, using the SOA (Service Oriented...
2
by: Paul Craig | last post by:
Hi everyone, I have recently upgraded several of my projects from Visual Studio 2003 to 2005 and everything went across quite smoothly. The main problem that I am having is I have used SQL Data...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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,...

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.