473,385 Members | 2,069 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,385 software developers and data experts.

Updating a BindingSource that uses a Join!

Hi,

I have both a Customer and a Orders Table, the key field is CustomerID. I
also have a DataGrid that uses a BindingSource which uses a dataset which
uses a join between the Customers table and the Orders table. Everything
displays correctly and when I double click on a row within the datagrid I
then open up a tabbed form that contains a detailed view of the record
selected. The user at this point is able to make changes to the record and
they are properly propogated back to the BindingSource. The problem is that
the TableAdapter does not contain the appopriate update, New SQL in order to
perform the update, therefore I am not able to call the TableAdapter.Update
method with the dataset as I would had I created a tableadapter not using a
join.

How am I best to handle this situation.

Thanks,
Aug 29 '06 #1
4 2948
Rob,

The answer is very simple, the table adapter is build to update one real
table, not a joined datatable.

This needs in my opinion an other approach,

Does not help, however maybe fine to know.

Cor

"Rob Dob" <ro************@yahoo.comschreef in bericht
news:uC**************@TK2MSFTNGP04.phx.gbl...
Hi,

I have both a Customer and a Orders Table, the key field is CustomerID. I
also have a DataGrid that uses a BindingSource which uses a dataset which
uses a join between the Customers table and the Orders table. Everything
displays correctly and when I double click on a row within the datagrid I
then open up a tabbed form that contains a detailed view of the record
selected. The user at this point is able to make changes to the record
and they are properly propogated back to the BindingSource. The problem
is that the TableAdapter does not contain the appopriate update, New SQL
in order to perform the update, therefore I am not able to call the
TableAdapter.Update method with the dataset as I would had I created a
tableadapter not using a join.

How am I best to handle this situation.

Thanks,

Aug 29 '06 #2
Hi,
The answer is very simple, the table adapter is build to update one real
table, not a joined datatable.

This needs in my opinion an other approach,
I understand this, but is there a way to post the updates of my databound
controls back to my two tables referred to within my bondingsource created
using a join. Basically the reason I'm using a join is that I want to
display both information from the orders table and customer table within my
dataview.

Thanks.
Aug 29 '06 #3
Mel
No, you must save the changes yourself individually to each table without
using the join.

"Rob Dob" <ro************@yahoo.comwrote in message
news:ub**************@TK2MSFTNGP04.phx.gbl...
Hi,
>The answer is very simple, the table adapter is build to update one real
table, not a joined datatable.

This needs in my opinion an other approach,

I understand this, but is there a way to post the updates of my databound
controls back to my two tables referred to within my bondingsource created
using a join. Basically the reason I'm using a join is that I want to
display both information from the orders table and customer table within
my dataview.

Thanks.


Aug 29 '06 #4
Hi,
No, you must save the changes yourself individually to each table without
using the join.
Can I import the contents of fields with matching names from my
bindingsource to the two appropriate dataset that belong to each of my two
tables? What is the recommended approach to doing this?

Or is there a way to maybe display the contents of two different tables
within my one datagridview

Thanks,

Aug 29 '06 #5

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

Similar topics

2
by: Daniel R. Rossnagel | last post by:
To determine from assembly whatever bindingsource has the form that uses this assembly and to obtain a listing of such
5
by: Mark R. Dawson | last post by:
Hi all, I may be missing something with how databinding works but I have bound a datasource to a control and everything is great, the control updates to reflect the state of my datasource when I...
0
by: Geoff | last post by:
Hi folks Calling BindingSource.ResetCurrentItem() is changing the BindingSource.Position in a way I don't understand. If I'm understanding the docs correctly, ResetCurrentItem() should simply...
3
by: Carlos Cruz | last post by:
Hi, I've a DataGridView with Datasourse = Datatable. The problem is that I can't get my last record updated at the database unless I change the row where I'm editing... Can anyone explain me...
1
by: Rob Dob | last post by:
Hi, I have both a Customer and a Orders Table, the key field is CustomerID. I also have a DataGridView that uses a BindingSource created using a join between the Customers table and the Orders...
13
by: Dale Harris | last post by:
I'm getting really strange behaviour where the data source RowState is not being updated to modified in some circumstances. I place my controls on a form, bind them through a BindingSource control...
2
by: =?Utf-8?B?VmFuZXNzYQ==?= | last post by:
Hi All! I am with a situation where I am not getting the right updating to the form's fields. The situation is the following one: I have one combobox and one textbox. I am using the...
2
by: jehugaleahsa | last post by:
Hello: I'm working on improving some of our Windows Forms. I have created two user controls that I want to bind to the same BindingSource. I have an overview control that is used just to...
5
by: jehugaleahsa | last post by:
Hello: I am sure this question comes up a lot. I need to disable the controls on my Windows forms so that when the BindingSource is empty some the controls bound to it will be disabled. This...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
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
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,...
0
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...

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.