Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8787123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:48:25+00:00 2026-06-13T21:48:25+00:00

I have a parent-child relation setup between two tables. The parent table is setup

  • 0

I have a parent-child relation setup between two tables. The parent table is setup with an auto increment value for its primary key. This is working fine and the new row in the parent DataTable is refreshed with the actual value of the key that was just inserted when I call Update on the TableAdaptor.

The problem is that the rows from the child table are not being inserted into the DB. For debug purposes, I added changesBefore and changesAfter to the code sample to see what changed rows exist in the child table. When I step through the code with a debugger, changesBefore constains the new child rows. changesAfter is Nothing. Its almost as if calling Update against the header table is triggering AcceptChanges on the child table.

I am familiar with insert/updating with DataTables and TableAdapters but this is my first attempt at using an autoincrement on a parent table. What am I missing here?

        Dim changesBefore = _ds.ResponseDetails.GetChanges

        headersTa.Update(_ds.ResponseHeaders)

        Dim changesAfter = _ds.ResponseDetails.GetChanges

        detailsTa.Update(_ds.ResponseDetails)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T21:48:27+00:00Added an answer on June 13, 2026 at 9:48 pm

    This is working now. Turns out there is an AcceptRejectRule property for each relation in a data set. I had the rule set to Cascade so it was basically cascading AcceptChanges down to the child table when Update was called against the parent. Changing the rule to None resolved my issue.

    http://msdn.microsoft.com/en-us/library/system.data.acceptrejectrule(v=vs.80).aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to search in two tables that are in a parent-child relation (1:n)
I have 2 tables (say parent and child table and 1 to many relation),
I have a one-to-many relation between Parent and Child table. In the parent object
Lets say I have two tables - child and parent with many-to-one relation. What
I have multiple level parent-child tables(GrandParent, Parent and Child, all many to one relation,
I have a simple parent/child tables. Contract is the parent table. Each contract can
I'm having a problem with LINQ. I have 2 tables (Parent-child relation) Table1: Events
i have a relation (one to many/ many to one) between parent and child
I have a table Parent and a table Child. Child contains a foreign-key to
I have a Table where Parent Child Relation ship is stored as: ChildID Name

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.