ADO.NET related tables cascade update

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Ruud (rwh.ortmans_at_hccnet.nl)
Date: 02/25/04

  • Next message: JerryF: "run time error '3706' Provider Cannot Be Found"
    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
    >.
    >


  • Next message: JerryF: "run time error '3706' Provider Cannot Be Found"

    Relevant Pages

    • Re: ADO.net cascading update
      ... > I have two tables Orders and Orderdetails. ... Orders primary key is ORDERID ... autoincrement properties to avoid conflicts with the datasource. ...
      (microsoft.public.dotnet.framework.adonet)
    • RE: Foreign Key self-join on a DataTable
      ... AutoIncrement columns aren't automatically updated by the database (as far ... > OrderID ... > the identity in the row, and then update the OrderParent in all child rows. ...
      (microsoft.public.dotnet.languages.csharp)
    • Re: Summing records selected
      ... information from a hidden part of the database to get this. ... Our database ranges from OrderID 12 ... "Duane Hookom" wrote: ...
      (microsoft.public.access.reports)
    • Re: Defining field for subform
      ... Just use a form bound to the Orders form, with a subform bound to the OrderDetails table. ... As for how to assign it to the subform, a continuous unbound subform is not going to work. ... Set rstNewOrder = DBS.OpenRecordset ... I need to set the OrderID as a field in the OrderDetails table. ...
      (microsoft.public.access.modulesdaovba)
    • Re: Export Field Name
      ... Are you going to export all three fields (orderID, userID, and orderID2)? ... you are breaking the cardinal rule of normalized database design. ... You don't store redundant information. ...
      (microsoft.public.access.queries)