B
Brice Cave
I am loading a Typed Dataset using another dataset via each table's Load() Method and getting a ConstraintException on one of the tables.
Disabling the constraints before the load and Enabling constraints after the load produces the same error.
Leaving the constraints disabled should not be an option. I want to know what is blowing the constraint.
I am loading the data using this method because I want one trip to the database to return multiple resultsets/tables via a stored proc, and I have to use our existing data access layer which does not expose a DataAdapter, just a dataset via method call. I have to use the Load method and pass an DataReader from CreateReader.
Is there ANY way to figure out which of the columns/rows are causeing the ConstraintException ? (Eyeballing rows in the DataTable Visualizer does not count )
1) I have tried trapping in a delegate for FillErrorEventHandler passed to the Load method on the DataTable. This does no good because it seems the constraints are not enforced until after the entire table is loaded with data.
2) I have tried handling the RowChanging Event and looking there, but it is no good becuase of the same reason as statement #1.
3) try/catch does no good because the error message is not verbose. It just says that there was a ConstraintException.
I have tried eyeballing each column's constraints in the Properties window while in the DataSet Designer and the datatable rows thru the visualizer to no avail. Everything 'looks' good (40 rows to search, so might miss something).
I removed any primary keys on the datatable. Still get the error.
Is there any way to list the contraints on a table?
-Brice
EggHeadCafe.com - .NET Developer Portal of Choice
http://www.eggheadcafe.com
Disabling the constraints before the load and Enabling constraints after the load produces the same error.
Leaving the constraints disabled should not be an option. I want to know what is blowing the constraint.
I am loading the data using this method because I want one trip to the database to return multiple resultsets/tables via a stored proc, and I have to use our existing data access layer which does not expose a DataAdapter, just a dataset via method call. I have to use the Load method and pass an DataReader from CreateReader.
Is there ANY way to figure out which of the columns/rows are causeing the ConstraintException ? (Eyeballing rows in the DataTable Visualizer does not count )
1) I have tried trapping in a delegate for FillErrorEventHandler passed to the Load method on the DataTable. This does no good because it seems the constraints are not enforced until after the entire table is loaded with data.
2) I have tried handling the RowChanging Event and looking there, but it is no good becuase of the same reason as statement #1.
3) try/catch does no good because the error message is not verbose. It just says that there was a ConstraintException.
I have tried eyeballing each column's constraints in the Properties window while in the DataSet Designer and the datatable rows thru the visualizer to no avail. Everything 'looks' good (40 rows to search, so might miss something).
I removed any primary keys on the datatable. Still get the error.
Is there any way to list the contraints on a table?
-Brice
EggHeadCafe.com - .NET Developer Portal of Choice
http://www.eggheadcafe.com