RE: Architecture SQL,Datasets and relationships
From: Crad (anonymous_at_discussions.microsoft.com)
Date: 03/05/04
- Next message: Felbrigg: "Re: Using DateTime Picker"
- Previous message: Miha Markic [MVP C#]: "Re: telling when the db connection is retrieveing data"
- In reply to: Kevin Yu [MSFT]: "RE: Architecture SQL,Datasets and relationships"
- Next in thread: Magnus Blomberg: "Re: Architecture SQL,Datasets and relationships"
- Reply: Magnus Blomberg: "Re: Architecture SQL,Datasets and relationships"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 5 Mar 2004 02:51:06 -0800
You're right Kevin, but consider this scenario:
Customers and orders tables, with foreign key constraints both in sql server and dataset
You have an id in Custormers table with autoincrement set to true, so you're forced to update customers table first, in order to get the real id value, then update this id in the orders table and finally you can call the update method for the Orders DataAdapter
Now, if you are inserting a new customer it works fine (and it's the only way to do the work), but if you are deleting a customer you need to invert the order of the update method calls.
I had similar problem about a week ago and I had to disable the foreign key constraints in SQL Server.
Is there a better way to handle it?
- Next message: Felbrigg: "Re: Using DateTime Picker"
- Previous message: Miha Markic [MVP C#]: "Re: telling when the db connection is retrieveing data"
- In reply to: Kevin Yu [MSFT]: "RE: Architecture SQL,Datasets and relationships"
- Next in thread: Magnus Blomberg: "Re: Architecture SQL,Datasets and relationships"
- Reply: Magnus Blomberg: "Re: Architecture SQL,Datasets and relationships"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|