?
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
?
840 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
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…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

765 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