How to lock tabel with LINQ to SQL (转载)# Database - 数据库
f*e
1 楼
【 以下文字转载自 DotNet 讨论区 】
发信人: flyfire (flyfire), 信区: DotNet
标 题: How to lock tabel with LINQ to SQL
发信站: BBS 未名空间站 (Mon Feb 16 23:56:26 2009)
Here is the table:
Col1, Seqno, ...
A, 1, ...
A, 2, ...
A, 3, ...
B, 1, ...
C, 1, ...
(Col1 + seqno) is the primary key.
When I use LINQ to insert a new record, I need to calculate next seqno. For
example, if I want to insert a new row with value A in col1, the seqno will
be 4.
It is not hard to do the calculation. But the problem is that I need to lock
the
发信人: flyfire (flyfire), 信区: DotNet
标 题: How to lock tabel with LINQ to SQL
发信站: BBS 未名空间站 (Mon Feb 16 23:56:26 2009)
Here is the table:
Col1, Seqno, ...
A, 1, ...
A, 2, ...
A, 3, ...
B, 1, ...
C, 1, ...
(Col1 + seqno) is the primary key.
When I use LINQ to insert a new record, I need to calculate next seqno. For
example, if I want to insert a new row with value A in col1, the seqno will
be 4.
It is not hard to do the calculation. But the problem is that I need to lock
the