none
Composite Primary Key RRS feed

  • Question

  • I have a table with Composite PRIMARY KEY CLUSTERED with 2 fields. Those fields are also foreign keys. I have problems to insert new record. I have correct values for all fields but get error on SubmitChanges();  the error is cannot convert string to integer. I add a stored procedure with the same values and it executes correctly. I checked also in the code generated by linq both field has IsPrimaryKey=true attribution. Any help would be greatly appreciated.                    

     

    Friday, April 18, 2008 11:31 PM

Answers

  • Can you share the DDL for both the tables? Is the order in which the fields are listed in the PK and the FK different?

     

    It is possible that this is because of a bug that is already known to us - but sharing the scripts for creating your tables in question will help me confirm for sure.

     

    Thanks.

    ---

    Faisal Mohamood | Program Manager | LINQ to SQL

     

    Monday, April 21, 2008 11:15 PM
    Moderator

All replies

  • Can you share the DDL for both the tables? Is the order in which the fields are listed in the PK and the FK different?

     

    It is possible that this is because of a bug that is already known to us - but sharing the scripts for creating your tables in question will help me confirm for sure.

     

    Thanks.

    ---

    Faisal Mohamood | Program Manager | LINQ to SQL

     

    Monday, April 21, 2008 11:15 PM
    Moderator
  • As there has been no further activity on this thread for over a month I'm going to mark it as closed.

     

    Should you want to continue the discussion please feel free to reopen it Smile

     

    [)amien

    Wednesday, May 28, 2008 9:04 PM
    Moderator