I have a master detail relationship set up in a dataset as follows:
ds.Tables[0].TableName =
"RATING_SET";
ds.Tables[0].PrimaryKey =
new DataColumn[] { ds.Tables[0].Columns["RATING_SET_ID"] };
ds.Tables[1].TableName =
"RATINGS";
ds.Tables[1].PrimaryKey =
new DataColumn[] { ds.Tables[1].Columns["RATING_SET_ID"], ds.Tables[1].Columns["RANK"] };
ds.Relations.Add (
"RATINGS_FK" , ds.Tables[0].Columns["RATING_SET_ID"] , ds.Tables[1].Columns["RATING_SET_ID"] );
The column Rating_Set_id column exists in both bands. Following exception is thrown:
+ InnerException {"ForeignKeyConstraint RATINGS_FK requires the child key values (0) to exist in the parent table."} System.Exception {System.Data.InvalidConstraintException}
Do I have to use a WebHierarchicalDataSource? What gives?
Hello mdelgado,
it is not necessarily to use WebHierarchicalDataSource, this can be done with DataSet as you started.
Please find the attached sample showing how to implement manual crud operations on the parent and child bands.
Hope this helps