ADO.NET related tables cascade update
From: Ruud (rwh.ortmans_at_hccnet.nl)
Date: 02/25/04
- Previous message: Eric Margheim: "Re: Timeout Expired Errors - Need Expert Consultant - Have done a ton of research already"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 25 Feb 2004 06:09:18 -0800
Hi Bill,
In the relationship between the two tables you must set
the the Update to Cascade. You can do this in either the
database (I asume that you use sql server) or in the
dataset.
You can edit the relationship in Visual Studio.Net with
the server explorer for the database or at the dataset
with view schema.
Mail me about the results.
Ruud.
>-----Original Message-----
>Hi,
>
>I am working on a db management system with several
related tables. For this question I will reduce this to
only to tables.
>
>I have two tables Orders and Orderdetails. Orders
primary key is ORDERID and OrderDetails Foreign key is
ORDERID. I have set the datatable autoincrement
properties to avoid conflicts with the datasource.
However when I try to update the datasource only the
Orders table is updated to the proper key value. The
orderdetail table contains the datatables ORDERID value
before the update.
>
>For this process I am using two dataadapters...one for
each table. I am setting the foreignkey constraint in
orderdetails table to the ORDERID column in the orders
table. I am updating with each dataadapter (Order table
first).
>
>Can someone please give me a heads up on this....
>
>Thanks,
>Bill
>.
>
- Previous message: Eric Margheim: "Re: Timeout Expired Errors - Need Expert Consultant - Have done a ton of research already"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|