473,395 Members | 1,348 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Parent Child Relationships in the DataSet - SQL 2000

Sorry to bother you guys but I have another questions related to DataSets.

I'm almost there now, so I dont expect to bug you much more ( Hopefully ).

I have Master / Details tables with cascading relationships between them.

When I Update the master using the DataAdapter we get a new ID for the new
master row and all the child row foreign keys are updated to the newly
aquired ID.

However, from an article below from bill vaughn, he suggests ( Unless I
have misunderstood ) that the child rows would be automatically inserted
into the SQL Database after the master row has been created and they get
their foreign keys.

http://msdn.microsoft.com/library/de...anidcrisis.asp

I am at a bit of a loss as to how this could be done with one insert command
( Not demonstrated in the article ). If you configure a second DataAdapter
for the Details table, this does not insert the rows after the initial
Master row creation.

I would appreciate some help as to where I may be going wrong ?

Thanks In Advance !

--
Best Regards

The Inimitable Mr Newbie º¿º
Nov 23 '05 #1
1 2116
Hi,

"Mr Newbie" <he**@now.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Sorry to bother you guys but I have another questions related to DataSets.

I'm almost there now, so I dont expect to bug you much more ( Hopefully ).

I have Master / Details tables with cascading relationships between them.

When I Update the master using the DataAdapter we get a new ID for the new
master row and all the child row foreign keys are updated to the newly
aquired ID.

However, from an article below from bill vaughn, he suggests ( Unless I
have misunderstood ) that the child rows would be automatically inserted
into the SQL Database after the master row has been created and they get
their foreign keys.

http://msdn.microsoft.com/library/de...anidcrisis.asp
<quote>When you execute the Update method, ADO.NET executes the INSERT for
the parent row first and then all associated child rows. </quote>

I think he just meant that first the parents rows are inserted then the
related child rows but not necessarily with one DataAdapter.Update. Just
after that he starts explaining how to do the actual update using two
DataAdapters (parent/child) in three steps (to avoid concurrency issues) and
that's what you should do.

See above/below "Listing 1. Correct Update method sequencing" in the
article.

HTH,
Greetings

I am at a bit of a loss as to how this could be done with one insert
command
( Not demonstrated in the article ). If you configure a second DataAdapter
for the Details table, this does not insert the rows after the initial
Master row creation.

I would appreciate some help as to where I may be going wrong ?

Thanks In Advance !

--
Best Regards

The Inimitable Mr Newbie º¿º

Nov 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Lumpierbritches | last post by:
Thank you in advance for all your assistance, it is GREATLY appreciated. I'm writing a small Access 2000 program for tracking Kennel Litters for a friend and I'm wondering how I can loop through...
3
by: Darryn Ross | last post by:
Hi, How do i get my datagrid to display the contents of two related tables setup in my access database, so i can see the plus/minus sign to expand retract the Child details? Regards Darryn
4
by: Danny Tuppeny | last post by:
Hi all, I've been trying to write some classes, so when I have a parent-child relationship, such as with Folders in my application, I don't have to remember to add a parent reference, as well as...
1
by: Mr Newbie | last post by:
Sorry to bother you guys but I have another questions related to DataSets. I'm almost there now, so I dont expect to bug you much more ( Hopefully ). I have Master / Details tables with...
0
by: Mr Newbie | last post by:
Sorry to bother you guys but I have another questions related to DataSets. I'm almost there now, so I dont expect to bug you much more ( Hopefully ). I have Master / Details tables with...
3
by: dbuchanan | last post by:
Hello, How do I create a Parent-Child relationship between two DataGridView in a form using TableAdapters. The two tables already have a relationship defined in the dataset. What event do I...
10
by: Goran Djuranovic | last post by:
Hi all, Does anyone know how to declare a variable in a class to be accessible ONLY from a classes instantiated within that class? For example: ************* CODE ***************** Public...
3
by: reachsamdurai | last post by:
Is it possible to determine the list of child/parent tables for a particular table from any system catalog tables? Using the syscat.tables I'm able to retrieve the no of dependent parent/child...
4
by: mikemiller.innova | last post by:
In Visual Studio 2005 SP1, I added a DataSet item into my project. I added 3 tables from SQL that have data and relationships. I added 2 lookup columns (lkp) to the DllVersions table in the...
8
by: Rick | last post by:
VS 2005 I' m setting up a parent/child datagridviews in a form. I am doing a lot of this by hand coding in order to get the feel of things. I want a change in the parent table to trigger a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.