Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 updating my table using my dataset

Author  Topic 

rtutus
Aged Yak Warrior

522 Posts

Posted - 2006-02-27 : 02:54:49
Hi I populate a datagrid with my dataset, then I edit the datagrid which results in updating my dataset as well.
The problem: My datset gets the data from joined tables.

In my datagrid, I display Tbl1.col1, Tbl1.col2, Tbl1.col3 and Tbl2.col2, tbl2.col3 and tbl2.col4
Tbl2 is my look up table from which I get the prices and dealer codes.

My need: So I need to update in my table1 all its columns in addition to the the id that I use for my join.

I get error message saying I can t update using dataadapter when I have more than a table in my select command query.



Thanks

shallu1_gupta
Constraint Violating Yak Guru

394 Posts

Posted - 2006-02-27 : 03:49:27
Hi,
you can use
DataSet.GetChanges(DataRowState.Modified )
This will return a dataset listing the rows which are modified.
loop till that many number of rows and with in a loop build a respective update statement and update the table1 with the current values for the respective id
Go to Top of Page

rtutus
Aged Yak Warrior

522 Posts

Posted - 2006-03-03 : 21:40:09
Thanks
Go to Top of Page
   

- Advertisement -