• Question

  • I am using LINQ to SQLto work with related tables.  The FK tables have their own PK.  When inserting into the FK tables, I get the error telling me on one table that the insert did not work because the "INSERT_IDENTITY SET TO OFF."   I understand with TSQL that only one table can have it turned on at a time and that the SQL statements need to set it to ON then OFF, but since I am using LINQ, I do not know where to find the SQL to include the ON and OFF statements.   Or if there is a different way to handle this.  Thanks for any help on this. 

    Tuesday, July 8, 2008 3:38 PM


  • Figured this out.  Just needed to delete my connection to the db and create a new one, then delete and re-add the tables to my LINQ schema.  My error, I forgot that after making a change to the table in SQL Server, I needed to do the above.  All works fine now.  

    Tuesday, July 8, 2008 5:23 PM