由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
DotNet版 - How to lock tabel with LINQ to SQL
相关主题
问一个linq to sql编程问题 (转载)Linq to entity framework: what happens if i modified DB schema in SSMS ?
痛苦IT大妈求助nHibernate mapping question
找.NET的工作C# DateTime to Oracle Date
asp.net为啥用linq来操作数据库呢,为啥不直接用sql语言?Do we still need DAL
菜人问问,你们都在database上干什么??有人试过.Net 3.0吗?
linq在debug的时候看不出错误的地方啊。Converting a CSV file to XML using LinQ
.net操作数据库的方法,哪个最好?是不是最近dotnet不济了
LINQ to SQL VS Entity Framework最不爽的就是c#搞了不少syntax sugar就为了少打几个字
相关话题的讨论汇总
话题: seqno话题: linq话题: col1话题: lock话题: sql
进入DotNet版参与讨论
1 (共1页)
f*****e
发帖数: 5177
1
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 table when I do that since i don't want another connection to get the
same seqno. Is there a way to do that?
c**e
发帖数: 2558
2
read section "Handling concurrency" in book 《LINQ in Action》

For
will
lock

【在 f*****e 的大作中提到】
: 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

1 (共1页)
进入DotNet版参与讨论
相关主题
最不爽的就是c#搞了不少syntax sugar就为了少打几个字菜人问问,你们都在database上干什么??
some1 using nhibernate?linq在debug的时候看不出错误的地方啊。
some1 using nhibernate?.net操作数据库的方法,哪个最好?
[合集] some1 using nhibernate?LINQ to SQL VS Entity Framework
问一个linq to sql编程问题 (转载)Linq to entity framework: what happens if i modified DB schema in SSMS ?
痛苦IT大妈求助nHibernate mapping question
找.NET的工作C# DateTime to Oracle Date
asp.net为啥用linq来操作数据库呢,为啥不直接用sql语言?Do we still need DAL
相关话题的讨论汇总
话题: seqno话题: linq话题: col1话题: lock话题: sql