I've got an application that's reading thousands of rows from a file and inserting them into a database. I'm updating my code to use LINQ (before I used the SQL classes and inserted one by one). However, from time to time, we get a record in the file that is already in the database. In this situation, when I call SubmitChanges(), I get a SqlException for trying to insert a duplicate key row. How can I tell which record it failed on, without having to call SubmitChanges() on every record? I saw another
Read More...