Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Gridview error: Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.

Reply
Thread Tools

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

 
 
Bobby Edward
Guest
Posts: n/a
 
      10-13-2008
I have a gridview that is databound to an objectdatasource. The ODS
utilizes a XSD Dataset that was created.

I keep getting this error when viewing the page: Failed to enable
constraints. One or more rows contain values violating non-null, unique, or
foreign-key constraints.

The query (MySQL) works fine thru the query tool.

I MANUALLY checked the data and it is fine as well.

Here's the actual query...
SELECT DISTINCT companytypes.CompanyType, users.Company,
users.CompanyTypeId, users.ContactAddress1, users.ContactAddress2,
users.ContactCity,users.ContactState, users.ContactZip, users.ContactPhone,
users.ContactFax, users.CompanyDescription
FROM users INNER JOIN companytypes ON users.CompanyTypeId =
companytypes.CompanyTypeId
ORDER BY companytypes.CompanyType, users.Company

Any ideas?


 
Reply With Quote
 
 
 
 
bob
Guest
Posts: n/a
 
      10-14-2008
Hi Bobby,
Suggest go over the xsd with a fine tooth comb checking the Unique and
NullValue properties
good luck.
Bob
On Mon, 13 Oct 2008 12:01:48 -0400, "Bobby Edward" <(E-Mail Removed)>
wrote:

>I have a gridview that is databound to an objectdatasource. The ODS
>utilizes a XSD Dataset that was created.
>
>I keep getting this error when viewing the page: Failed to enable
>constraints. One or more rows contain values violating non-null, unique, or
>foreign-key constraints.
>
>The query (MySQL) works fine thru the query tool.
>
>I MANUALLY checked the data and it is fine as well.
>
>Here's the actual query...
>SELECT DISTINCT companytypes.CompanyType, users.Company,
>users.CompanyTypeId, users.ContactAddress1, users.ContactAddress2,
>users.ContactCity,users.ContactState, users.ContactZip, users.ContactPhone,
>users.ContactFax, users.CompanyDescription
>FROM users INNER JOIN companytypes ON users.CompanyTypeId =
>companytypes.CompanyTypeId
>ORDER BY companytypes.CompanyType, users.Company
>
>Any ideas?
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RCR: String#contain? and Array#contain? Roger Pack Ruby 3 09-28-2010 04:13 PM
Does string contain A, and if so, does a section of string contain B Jason Carlton Javascript 11 12-08-2009 06:07 PM
Hide the Gridview Rows and Header rows in Button click VijayRama ASP .Net 2 10-12-2009 01:58 PM
Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints. Bobby Edward ASP .Net 4 11-03-2008 10:53 PM
Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints. bazzer ASP .Net 1 04-06-2006 01:31 PM



Advertisments