L
Lars Netzel
Hi! I
Im having problems adding a DataRelation to the RelationCollection of a datatable in a dataset (filled from an SQL server) .
'**************************'
Dim myRelation As New DataRelation("ActivityMembers", dsActivities.Tables(0).Columns("PROJACTIVITY_ID"), dsActivities.Tables(1).Columns("PROJACTIVITY_ID"))
dsActivities.Relations.Add(myRelation)
'********************************
The Second row gives the error "This constraint cannot be enabled as not all values have corresponding parent values".
This only happens if the Childtable, Table(1), does'nt contain any posts. If I do have some post the relation works fine. but I can't asume I will have Items in the Child Table, how do I fix this?
Best Regards
/Lars
Im having problems adding a DataRelation to the RelationCollection of a datatable in a dataset (filled from an SQL server) .
'**************************'
Dim myRelation As New DataRelation("ActivityMembers", dsActivities.Tables(0).Columns("PROJACTIVITY_ID"), dsActivities.Tables(1).Columns("PROJACTIVITY_ID"))
dsActivities.Relations.Add(myRelation)
'********************************
The Second row gives the error "This constraint cannot be enabled as not all values have corresponding parent values".
This only happens if the Childtable, Table(1), does'nt contain any posts. If I do have some post the relation works fine. but I can't asume I will have Items in the Child Table, how do I fix this?
Best Regards
/Lars