DBUpdateException in LINQ to Entity Framework RRS feed

  • Question

  • Hi .
    I have created a linq query that used to inset data into 'Production'  table with the database
    this table has trigger that fired on insert ,this trigger used to insert some data into 'TransactionHistory' table ,

    --after each production insert the trigger will insert to TransactionHistory table the produced Item and the consumed materials , 
    but in some cases conflict with akey is occured when trying inseting non balance covered materials 

    i want to pick this itemid by using linq query ,
    if someone can help me , please reply .
    thanks for attention :)

    Monday, July 14, 2014 1:00 PM


All replies

  • Pick an itemid based on what? What is the condition that would make you want to pick an itemid?
    Monday, July 14, 2014 2:58 PM
  • each material item has an itemid , the balance column of transactionHistory has check constraint Balance>=0

    so if any type of material will be inserted with balance less than 0 it will make a conflict , so i want to know what is the conflicted itemid ?

    Tuesday, July 15, 2014 7:32 AM
  • You would just use a Linq query join where to join on the two tables and use a where clause I guess.

    Tuesday, July 15, 2014 7:29 PM