473,395 Members | 1,639 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.

FK Constraint enforcement AFTER initial save of parent

Here's the deal. I have a Typed Dataset. For simplicity, we'll say it has 2 tables Parent and Child with a FK in Child, relationname = FK, cascade on update. Kyes are negative autoincrement.

I bind Parent to dgParent and I bind dgChild to the Parent table, FK datamember. The grids work properly, except in the following scenario.

1. Add a new row to the parent table. (PK = -1)
2. Save. The new Parent key is updated from the return value of the stored procedure.
3. Add a new row to dgChild for the row in the parent table. Receive FKConstraint error message saying the FK value -1 must exist in the parent table.

If I add the child row BEFORE saving, it works great, but in the above scenario, the currencymanager for the child doesn't seem to have gotten the message that it should be using a new FK value.

Thanks,
Chris
--------------------------------
From: Chris Waldmann

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>QhvQTronDUuropZxUS7XHA==</Id>
Nov 17 '05 #1
0 1022

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

Similar topics

4
by: shenanwei | last post by:
Table 1: member (id int, name char(20)), id is the primary key Table 2: class (classid int, memberid int ), memberid is the FK to member (id), and has unique index on memberid Now Table 3:...
23
by: sandy | last post by:
I need (okay, I want) to make a dynamic array of my class 'Directory', within my class Directory (Can you already smell disaster?) Each Directory can have subdirectories so I thought to put these...
1
by: andrewst | last post by:
Originally posted by Victor M . No, Ana must have misread your insert! The SSN value '123456789' is fine. Originally posted by Victor M . ALTER TABLE EMPLOYEES MODIFY CONSTRAINT DNO DISABLE;...
15
by: Frank Swarbrick | last post by:
I have the following three tables DROP TABLE CALLTRAK.SERVICE_CODES @ CREATE TABLE CALLTRAK.SERVICE_CODES ( CODE CHAR(1) NOT NULL , CONSTRAINT SERVICE_CODES_PK PRIMARY KEY (CODE) ,...
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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.