ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.[Solved] Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraintsHi @Richa,<br />Please try the following<br /><br /><a href = 'link(Threads/103366/Failed-to-enable-constraints-One-or-more-rows-contain-values-violating-non-null-unique-or-foreign-key-constraints/)'>Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.</a><br /><br />It might help you.<br /><br />Cheers Andrea.https://www.aspforums.net:443/Threads/163178/Solved-Failed-to-enable-constraints-One-or-more-rows-contain-values-violating-non-null-unique-or-foreign-key-constraints/https://www.aspforums.net:443/Threads/163178/Solved-Failed-to-enable-constraints-One-or-more-rows-contain-values-violating-non-null-unique-or-foreign-key-constraints/Wed, 26 Aug 2015 02:55:50 GMT[Solved] Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints<p>@Andrea: Thank you for the reply.</p> <p>In your suggested solution, I got a useful link:&nbsp; <a href="http://stackoverflow.com/questions/6014365/asp-net-dataset-getdataby-failed-to-enable-constraints-one-or-more-rows-contain">http://stackoverflow.com/questions/6014365/asp-net-dataset-getdataby-failed-to-enable-constraints-one-or-more-rows-contain</a></p> <p>tried to follow the same but error still remains the same.</p> <p><span style="color: #3366ff;">Always I am getting error at below line:</span></p> <pre class="brush: csharp">rlist.DataSource = SDMBU.BUTest.GetAllRelationship();</pre> <p><span style="color: #3366ff;">at below function:</span></p> <pre class="brush: csharp">GetAllRelationship()</pre> <p>Please someone let me know what shall I change in my code? and what is the reason of this error ?&nbsp;</p> <p>Please reply</p>https://www.aspforums.net:443/Threads/163178/Solved-Failed-to-enable-constraints-One-or-more-rows-contain-values-violating-non-null-unique-or-foreign-key-constraints/https://www.aspforums.net:443/Threads/163178/Solved-Failed-to-enable-constraints-One-or-more-rows-contain-values-violating-non-null-unique-or-foreign-key-constraints/Wed, 26 Aug 2015 03:39:45 GMT[Solved] Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints<p>Hi Richa,</p> <p>Please check the Adapter.GetRelationship() method what the result you are getting. Else share your all code so that i can help you.</p>https://www.aspforums.net:443/Threads/163178/Solved-Failed-to-enable-constraints-One-or-more-rows-contain-values-violating-non-null-unique-or-foreign-key-constraints/https://www.aspforums.net:443/Threads/163178/Solved-Failed-to-enable-constraints-One-or-more-rows-contain-values-violating-non-null-unique-or-foreign-key-constraints/Wed, 26 Aug 2015 05:14:47 GMT[Solved] Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints<p>I created a new TableAdapter for binding the DropDownList and its working fine now. Previously I was using 1 TableAdapter to bind Grid as well as this DropDownList so only it was showing error.</p> <p>Thanks all for the help</p>https://www.aspforums.net:443/Threads/163178/Solved-Failed-to-enable-constraints-One-or-more-rows-contain-values-violating-non-null-unique-or-foreign-key-constraints/https://www.aspforums.net:443/Threads/163178/Solved-Failed-to-enable-constraints-One-or-more-rows-contain-values-violating-non-null-unique-or-foreign-key-constraints/Wed, 26 Aug 2015 08:50:41 GMT