Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
|
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 24th, 2003, 01:52 PM
Registered User
 
Join Date: Jun 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to AlanBell
Default 'System.Data.ConstraintException' - HELP PLEASE

I'm getting the following error while trying to update.

"A first chance 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."

Is there anyway for me to findout precisly which constraints are being violated? I'm having a heck of a time. Figuring this out. Thanks in advance for any help. I feel like I'm in the dark here.

Thanks
Alan Bell
 
Old July 1st, 2003, 02:23 AM
Authorized User
 
Join Date: Jun 2003
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Alan!

Can u debug ur app and get to know where it fails...may be u'll get to know a particular table where the constraint is violated...then it's easy to track all the related foreign constraints by looking up at the table design...I faced this problem too while developing my app...followed the same procedure....U may locate the line giving error... See whether an insert or Update statement is executed on that line...if yes, just copy that SQL statement in ur SQL Query Analyzer and see which are the related tables where problem is occuring...hope it helps...

cheers,
debsoft

Quote:
quote:Originally posted by AlanBell
 I'm getting the following error while trying to update.

"A first chance 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."

Is there anyway for me to findout precisly which constraints are being violated? I'm having a heck of a time. Figuring this out. Thanks in advance for any help. I feel like I'm in the dark here.

Thanks
Alan Bell





Similar Threads
Thread Thread Starter Forum Replies Last Post
System.Data.OleDb.OleDbException: No value given f tjgrindsted ASP.NET 2.0 Basics 0 January 24th, 2007 07:25 AM
System Data Types liamfitz Beginning VB 6 0 October 17th, 2006 05:31 PM
'SYSTEM.DATA.SQLCLIENT.SQLEXCEPTION' soorsha General .NET 0 September 23rd, 2006 11:59 PM
System.Data.SqlTypes bug? forkhead Pro VB.NET 2002/2003 0 March 25th, 2005 06:47 PM
Need Help in System.Data.SQL vavre ADO.NET 2 August 24th, 2003 10:28 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.