Problem using table aliases in ADO.net dataset
-
Hello, I have an access db that uses a recursive structure to store data i.e. there is a parts table (but there are three levels in the structure feature bill, level1 package, and then parts but they are all considered a part in the database I am extracting the nesting ability from an attribute in the parts table called style. Depending on the value of style i.e. style = 0 its a part, style = 1 it is level1package and style = 2 it is a feature bill) I am trying to generate a report that will show me for every feature bill, what level1 packages are in it and what parts are in each one of those packages. So I am essentially showing all the hierarchical levels of nesting. I am attempting to do this buy using a dataset that has multiple instances of my packages table(packages table is essentially the child element of the parts table) and linking the child node to the parent node each time until I reach the maximum amount of nesting I want. Can anyone help me out with setting up the dataset correctly? I am running into the following error: :System.Data.ConstraintException: Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints. at System.Data.DataSet.FailedEnableConstraints() at System.Data.DataSet.EnableConstraints() at System.Data.DataSet.set_EnforceConstraints(Boolean value) at System.Data.DataTable.EndLoadData() at System.Data.Common.DbDataAdapter.FillFromReader(Object data, String srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) at System.Data.Common.DbDataAdapter.Fill(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) I am not sure how to fix the problem and any help would be greatly appreciated, thanks in advance! Frank