[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

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

Posted on 2010-09-15
5
Medium Priority
?
842 Views
Last Modified: 2012-05-10
Using Visual Studio with MySQL.

In my XSD dataset I created a query. It runs perfect. I can preview the data fine.

In my BLL I wrote code (see below) to retrieve the query results and I'm getting...
Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.

Why would previewing the data work but in code it fails?

Any ideas?
Using db As New dsDemoTableAdapters.DemoTableAdapter
     Dim dt As New DataTable
     dt = db.GetDemo(DemoId) ' ERROR HAPPENS HERE

Open in new window

0
Comment
Question by:RobertNZana
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 9

Expert Comment

by:puru1981
ID: 33684937
are you using same id to for query and preview?

if not then please check if the query is returning null on some fields in join or duplicate data.
0
 
LVL 9

Author Comment

by:RobertNZana
ID: 33684972
the param (DemoId) is the exact same

i can literally see the data results when i preview the query in the xsd dataset
0
 
LVL 9

Expert Comment

by:puru1981
ID: 33685168
this is strange...i don't see any reason for this...
0
 
LVL 9

Author Comment

by:RobertNZana
ID: 33685327
exactly
0
 
LVL 9

Accepted Solution

by:
RobertNZana earned 0 total points
ID: 33720730
couldnt figure it out
0

Featured Post

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question