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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Failed to enable constraints error

Status
Not open for further replies.

ReportDr00

IS-IT--Management
Mar 2, 2007
194
US
Hello
I am getting below when access list of providers on my web app, i really appreciate if any one can assist in troubleshooting this.

Server Error in '/testsystem' Application.
--------------------------------------------------------------------------------

Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.ConstraintException: Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.

Source Error:


Line 4828: End If
Line 4829: Dim dataTable As testsystem.providersDataTable = New testsystem.providersDataTable
Line 4830: Me.Adapter.Fill(dataTable)
Line 4831: Return dataTable
Line 4832: End Function


 
the exception says it all. you are trying to fill rows in a datatable that have non-null references to other tables within the dataset. you must fill the parent table(s) first.

Jason Meckley
Programmer

faq855-7190
faq732-7259
 

I was handed this to figure out with very less knowledge of ASP.Net, but understand objects and syntax very well.
What should i be checking to figure out and fix the issue.
I appreciate your feedback. i have xsd and stored procedures are being accessed. Where do i go and look at?
 
there is a strongly typed dataset in your project named testsystem with a table named providersDataTable. that table has a relationship to other data tables in the dataset. data doesn't exist in the parent tables, so the exception is thrown.

*these assumptions are based on the provided code.

Jason Meckley
Programmer

faq855-7190
faq732-7259
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top