HighTechTalks DotNet Forums  

Multi-table Insert Problem

Dotnet Data Tools microsoft.public.dotnet.datatools


Discuss Multi-table Insert Problem in the Dotnet Data Tools forum.



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

Default Multi-table Insert Problem - 01-25-2007 , 10:54 PM






Here's the problem:

Using VS2005, 3 tables in a dataset linked hierarchically, stored externally
on SQL server.

When the update occurs, the identity of the first table gets cascaded to the
second table. The foreign key is then cascaded to the third table
correctly. But when the insert on the third table is generated, the
parameter for the primary key is not set to the correct value.

The datatables in the dataset look like this before the inserts,

T1 id=-1
T2 id=-1,line=1
T3 id=-1,line=1,subline=1

After the T1 insert,

T1 id=367
T2 id=367,line=1
T3 id=367,line=1,subline=1

T2 insert works fine. On the T3 insert when looking at the profile and the
command sent to SQL server, the @id=-1 not the expected @id=367.

Moving the values to the @parameters happens under the sheets. Does anyone
have any idea what could be going wrong?

Thanks,
MikeMOD




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.