Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Constraint Error with filling a dataset

Status
Not open for further replies.

Jim318

Programmer
Jul 1, 2002
33
0
0
US
Hi, I have a simple select query off of one table in my oracle database. I am using a where clause to search records added between two dates. If I go to configure my data adapter the query works fine. However, when I am populating the query results to the dataset I am receiving,

"An unhandled exception of type 'System.Data.ConstraintException' occurred in system.data.dll

Additional information: Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints."

I can still get the row count number from the result set but I cannot populate my datagrid because I cannot seem to get rid of this error.

Does anyone have any ideas? I think it probably has something to do with passing the dates (because I can get rid of the error by getting rid of the Where clause) but I haven't had any luck so far.

Thanks,
Jim

 
Try usgin some other field in the where clause and see if it works might just be the format of the dates....
 
My guess is that you're either formatting the dates in your WHERE clause incorrectly (or the variables holding them are typed wrong) or that there are one or more null dates in the table and the table isn't allowing null dates in those fields.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top