473,769 Members | 2,501 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2462
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(B yVal sqlStr As String, ByVal ds As DataSet,
ByVal mDatatable As String)
Dim Conn As New OleDbConnection (connString)
Try
Dim da As New OleDbDataAdapte r
Dim cmd As New OleDbCommand(sq lStr, Conn)
da.SelectComman d = cmd
Dim cb As OleDbCommandBui lder = _
New OleDbCommandBui lder(da)
If ds.HasChanges Then
da.Update(ds.Ge tChanges, mDatatable)
End If
Catch oledbExc As OleDbException
MessageBox.Show (oledbExc.ToStr ing)
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
1200
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, the "select" procedure shows one parameter. But, when I use the SQL Data Adapter Configuration Wizard to add this stored procedure to the SQLDataAdapter, I am not prompted for the field to be used as the parameter. I've tried deleting the...
0
1238
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 database. The data adapter configuration wizard generates both insert, and select statements, but on the final page of the wizard it says that update, and delete statements could not be generated. The reason that Im given for this happeneing is "could...
3
2294
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 statement. Is this limit adjustable? Thanks in advance. Al
2
1133
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 write these fields into another database? Or is there any other better way to do it? Thanks in advance
1
2109
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 following in the code: OracleDataAdapter1.SelectCommand.CommandText("select contract_no, wo_number, maint_type from sm_work_order where maint_type='UN' order by wo_number") It keeps giving me the error: "Property access must assign to the property...
1
2781
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 are replaced. If however 'Create new stored procedures' is selected as Command Type, the data table name in replaced by the name of the newly created select stored procedure. Problem with this is that the data table's name needs to be put back...
2
1264
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 which are on line.) This only occurs the first time after I open VB.NET. As long as VB.NET remains open subsequent clicks are almost instantanious. Any idea why it takes so long? Gary
1
4555
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 Architecture) approach. At various sites such as 15 Seconds (http://www.15seconds.com/issue/050721.htm) they advocate using the TableAdapter wizard to generate the data access layer. Describing the TableAdapter wizard, here is a quote from the...
2
1253
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 Adapters on many of the forms. These forms function fine in 2005 however I appear to be unable to configure the data adapters. In 2003 right clicking on the data adapter and selecting "Configure data adapter" allowed me to restructure the sql query...
0
10210
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
10039
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...
1
9990
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9860
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...
0
8869
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5297
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5445
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3955
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
3560
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.