Linq2SQL using Update StoredProcedure

Posted by PeterTheNiceGuy on Stack Overflow See other posts from Stack Overflow or by PeterTheNiceGuy
Published on 2010-03-01T16:57:01Z Indexed on 2010/03/16 12:36 UTC
Read the original article Hit count: 459

Filed under:
|

We use queries generated by Linq for data retrieval but for INSERT and UPDATE we do not allow generated SQL, but restrict to the use of stored procedures.

I connected the Update and the Insert behaviour in the DBML to the stored procedures. The procedures are called, the data gets inserted/updated = all if fine, except in the case of optimistic concurrency.

If a record was changed between retrieval and update, the update should fail.

When Linq generates the Update statement itself, it throws a ChangeConflictException as expected, but using the stored procedure no Exception is thrown.

Thanks a lot for any help on this!

© Stack Overflow or respective owner

Related posts about linq2sql

Related posts about stored-procedures