J
juli jul
Hello,following this code I got an error message:
the code:
System.Data.DataRelation dr;
System.Data.DataColumn dc1;
System.Data.DataColumn dc2;
// Get the parent and child columns of the two tables.
dc1 = ds.Tables[0].Columns[0];
dc2 = ds.Tables[1].Columns[0];
dr = new System.Data.DataRelation("db", dc1, dc2);
ds.Relations.Add(dr);
the error:
An unhandled exception of type 'System.Data.InvalidConstraintException'
occurred in system.data.dll
Additional information: Parent Columns and Child Columns don't have
type-matching columns.
Could someone explain me why? Thanks a lot!
the code:
System.Data.DataRelation dr;
System.Data.DataColumn dc1;
System.Data.DataColumn dc2;
// Get the parent and child columns of the two tables.
dc1 = ds.Tables[0].Columns[0];
dc2 = ds.Tables[1].Columns[0];
dr = new System.Data.DataRelation("db", dc1, dc2);
ds.Relations.Add(dr);
the error:
An unhandled exception of type 'System.Data.InvalidConstraintException'
occurred in system.data.dll
Additional information: Parent Columns and Child Columns don't have
type-matching columns.
Could someone explain me why? Thanks a lot!