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

Discussion in 'ASP .Net' started by Bobby Edward, Oct 13, 2008.

  1. Bobby Edward

    Bobby Edward Guest

    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?
     
    Bobby Edward, Oct 13, 2008
    #1
    1. Advertising

  2. Bobby Edward

    bob Guest

    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" <>
    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?
    >
     
    bob, Oct 14, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. bazzer
    Replies:
    1
    Views:
    4,980
    =?Utf-8?B?Y2xpY2tvbg==?=
    Apr 6, 2006
  2. Jeff
    Replies:
    2
    Views:
    466
  3. Bobby Edward
    Replies:
    4
    Views:
    7,720
    sloan
    Nov 3, 2008
  4. cs_in_va

    Failed to enable constraints

    cs_in_va, Feb 19, 2008, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    180
    Mr. Arnold
    Feb 19, 2008
  5. Roger Pack
    Replies:
    3
    Views:
    167
    Roger Pack
    Sep 28, 2010
Loading...

Share This Page