Click here to Skip to main content
15,909,737 members
Home / Discussions / C#
   

C#

 
GeneralRe: Connection pooling in windows.net Pin
Member 37818926-Jan-05 23:07
Member 37818926-Jan-05 23:07 
GeneralCapturing Video Pin
Deobrat Singh26-Jan-05 22:43
Deobrat Singh26-Jan-05 22:43 
GeneralServicedComponent object in server process Pin
kianboo26-Jan-05 21:27
kianboo26-Jan-05 21:27 
GeneralWindows login Pin
sharathgowda26-Jan-05 20:14
sharathgowda26-Jan-05 20:14 
GeneralRe: Windows login Pin
26-Jan-05 21:34
suss26-Jan-05 21:34 
GeneralRe: Windows login Pin
sharathgowda27-Jan-05 0:58
sharathgowda27-Jan-05 0:58 
GeneralRe: Windows login Pin
Dave Kreskowiak27-Jan-05 4:18
mveDave Kreskowiak27-Jan-05 4:18 
GeneralUpdating a database from a complex DataSet Pin
Luis Alonso Ramos26-Jan-05 18:11
Luis Alonso Ramos26-Jan-05 18:11 
Hello,

This is a tough question that's driving me nuts. I have a stored procedure that returns three tables, which I store in a DataSet. The records in one of the tables (table 1, also contains a JOIN) contain foreing keys from the other two tables.

My UI (a dialog box) lets the user add, edit and remove records in the three tables. He can even add a record in the first table with the foreign keys of the recently added records in tables 2 and 3.

The PK for all three tables are autogenerated (identity), and in the DataSet they are negative values (so they don't collide with the real values in the database.)

My question is, how do I call DataAdapter.Update to save all the changes to the database? It's not that easy because:

* The records in table 1 may contain references to records in the other two tables, whose PK are negative values. The references in table 1 must be updated to the actual values given in the database.

* Table 1 contains a JOIN, but also the PK from the joined table (other that these three) so it shouldn't be a problem, if I can manually update without including that column.

* Different tables, different commands to update. The data adapter only lets me specify one update, insert, and delete command; and here it must be different for each table.

Is there a "simple" way to do it? or should I go through all the changes and do the updates manually? is it a lot of work?

Thanks in advance for any help,

-- LuisR



Luis Alonso Ramos
Intelectix - Chihuahua, Mexico

Not much here: My CP Blog!

Generalusing wsdl.exe to generate webservice server and proxy Pin
rana7426-Jan-05 16:36
rana7426-Jan-05 16:36 
Generalaccessing variables Pin
John L. DeVito26-Jan-05 14:05
professionalJohn L. DeVito26-Jan-05 14:05 
GeneralRe: accessing variables Pin
Heath Stewart26-Jan-05 14:22
protectorHeath Stewart26-Jan-05 14:22 
GeneralCustom Column Style (Windows Forms) Pin
epinaud26-Jan-05 10:14
epinaud26-Jan-05 10:14 
GeneralRe: Custom Column Style (Windows Forms) Pin
Heath Stewart26-Jan-05 14:35
protectorHeath Stewart26-Jan-05 14:35 
GeneralProgramming crystal reportsss Pin
primomak26-Jan-05 9:39
primomak26-Jan-05 9:39 
GeneralAdding assemblies to the GAC Pin
thepersonof26-Jan-05 8:27
thepersonof26-Jan-05 8:27 
GeneralRe: Adding assemblies to the GAC Pin
Nick Parker26-Jan-05 10:15
protectorNick Parker26-Jan-05 10:15 
GeneralGeneral .Net question Pin
Yaakov Davis26-Jan-05 8:11
Yaakov Davis26-Jan-05 8:11 
GeneralRe: General .Net question Pin
Heath Stewart26-Jan-05 14:44
protectorHeath Stewart26-Jan-05 14:44 
GeneralBinding DB to Controls Pin
Eyal Carmi26-Jan-05 3:00
Eyal Carmi26-Jan-05 3:00 
GeneralRe: Binding DB to Controls Pin
Heath Stewart26-Jan-05 14:50
protectorHeath Stewart26-Jan-05 14:50 
GeneralProgramming crystal reportsss Pin
primomak26-Jan-05 2:03
primomak26-Jan-05 2:03 
GeneralSystem wainning sound Pin
jzb26-Jan-05 1:35
jzb26-Jan-05 1:35 
GeneralRe: System wainning sound Pin
jzb26-Jan-05 17:51
jzb26-Jan-05 17:51 
Questionhow to programe winform to surppoort multiLanguage ? Pin
Fire.Rolland.Han26-Jan-05 0:24
Fire.Rolland.Han26-Jan-05 0:24 
AnswerRe: how to programe winform to surppoort multiLanguage ? Pin
Richard Schneider26-Jan-05 0:58
Richard Schneider26-Jan-05 0:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.