Hi Ahmad,
This is error occuring because your some records in your child table (Member) do not have a Nationality column that can be found in the Member table in the Code column. You can't have "orphaned" child records if you use relations.
>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.
-----------------------------------------
Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.comwww.prenia.comWeblog: blogs.prenia.com/cathi