HighTechTalks DotNet Forums  

Updating a BindingSource that uses a Join!

ASP.net Data Grid Control microsoft.public.dotnet.framework.aspnet.datagridcontrol


Discuss Updating a BindingSource that uses a Join! in the ASP.net Data Grid Control forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Rob Dob
 
Posts: n/a

Default Updating a BindingSource that uses a Join! - 08-29-2006 , 01:36 PM






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,



Reply With Quote
  #2  
Old   
Cor Ligthert [MVP]
 
Posts: n/a

Default Re: Updating a BindingSource that uses a Join! - 08-29-2006 , 02:07 PM






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" <robdob20012002 (AT) yahoo (DOT) com> schreef in bericht
news:uCPpkG5yGHA.1252 (AT) TK2MSFTNGP04 (DOT) phx.gbl...
Quote:
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,




Reply With Quote
  #3  
Old   
Rob Dob
 
Posts: n/a

Default Re: Updating a BindingSource that uses a Join! - 08-29-2006 , 02:56 PM



Hi,

Quote:
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.




Reply With Quote
  #4  
Old   
Mel
 
Posts: n/a

Default Re: Updating a BindingSource that uses a Join! - 08-29-2006 , 03:34 PM



No, you must save the changes yourself individually to each table without
using the join.



"Rob Dob" <robdob20012002 (AT) yahoo (DOT) com> wrote

Quote:
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.





Reply With Quote
  #5  
Old   
Rob Dob
 
Posts: n/a

Default Re: Updating a BindingSource that uses a Join! - 08-29-2006 , 04:39 PM



Hi,

Quote:
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,





Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.