|
-
Feb 9th, 2003, 11:20 AM
#1
Thread Starter
Lively Member
DataReleation Error!
Hi All,
I am getting this error :
(Additional information: This constraint cannot be enabled as not all values have corresponding parent values.)
And I’m creating this relation
Dim relMemberNat As DataRelation
relMemberNat = New DataRelation("MemNat", myDS.Tables("Nat").Columns("Code"), myDS.Tables("Member").Columns("Nationality"))
myDS.Relations.Add(relMemberNat)
- “Nat” table is the Nationalities list table with “Code” filed as PK
- “Member” table is the Members data table with “Nationality” normal filed stors the "Code" value.
Any idea please.
<><><><><><><><><><><><><><><><><><>
<><> REMEMBER,,,,KNOWLEDGE IS POWER <><>
<><><><><><><><><><><><><><><><><><>
-
Feb 9th, 2003, 11:24 AM
#2
Frenzied Member
It means that you have some entries in your child table that contain some values not included in your parent table. So you should check the related fileds to see if there is such an entry.
-
Feb 9th, 2003, 11:46 AM
#3
Thread Starter
Lively Member
Thank u Lunatic3,
You are right, no errors now, but the relation is not working.
Do you think the method I'm using is not correct?
<><><><><><><><><><><><><><><><><><>
<><> REMEMBER,,,,KNOWLEDGE IS POWER <><>
<><><><><><><><><><><><><><><><><><>
-
Feb 9th, 2003, 11:59 AM
#4
Frenzied Member
I dont know how you are utilizing this relation that you claim it does not work. Considering the syntax, it seems correct.
-
Feb 9th, 2003, 12:15 PM
#5
Thread Starter
Lively Member
This is a brief of what I am donning in this part
A window form displays all member basic information, this data stored to members database directly, one of these information is for member nationality.
Nationalities stored in a separate table lists only nationality and have “Code” field as PK.
In members form I’m displaying the nationality in ComboBox and I need the value to change according the nationality code stored in members table when the user clicks Next or Back buttons.
I found to make a relation between these 2 tables will do the job, but!!!
<><><><><><><><><><><><><><><><><><>
<><> REMEMBER,,,,KNOWLEDGE IS POWER <><>
<><><><><><><><><><><><><><><><><><>
-
Feb 9th, 2003, 02:18 PM
#6
Frenzied Member
Your parent table in the dataset should now contain an object called 'MemNat' (your relation name) and that containes the the filed of the child table. You should bind the desired control to this field.
You may like to look at this article for more info about working with master/details tables.
-
Feb 10th, 2003, 06:46 AM
#7
Thread Starter
Lively Member
I already did all that, but no luck!!
"Members" tabel moves fine but "Nat" table does not move points always to the first row.
<><><><><><><><><><><><><><><><><><>
<><> REMEMBER,,,,KNOWLEDGE IS POWER <><>
<><><><><><><><><><><><><><><><><><>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|