locked
Creating a dataset with Multiple tables RRS feed

  • Question

  • User-278874392 posted

    Hi there,

    I hope someone can help with this one. I have a dataset with 3 tables that are inner joined. Thsi dataset is connected to an object datasource which is connected to a gridview. So at runtime it displays data from the database. The problem is when I click on a save button to add information to the database it throughs me an error saying Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.

    But if i have two tables in my dataset it works 100%. But the problem i need that 3 tables in order to pull the required information.

    And if i populate the gridview using code to select the information from the database and insert information it also works 100%.

    Any idea what could be the problem?

    Friday, January 29, 2010 2:51 AM

Answers

All replies

  • User1611391320 posted

    buddy check in a non null field u are trying to insert null value or in unique field adding the same value again or if foreign key is there u are trying to insert a value in child table that is not present in parent table.

    Monday, February 1, 2010 12:02 AM
  • User2101710649 posted

    Hi Mistery,

        First check your tables structure then after you can insert your data. 

    Monday, February 1, 2010 2:19 AM
  • User1716267170 posted

    Hi Mistery1,

    It's a common error message. Please check this FAQ document first:

    http://forums.asp.net/t/1362351.aspx#_Why_do_I_1<o:p></o:p>

    Thanks. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, February 2, 2010 12:48 AM