linq to sql nolock

来源:互联网 发布:速龙数据恢复软件下载 编辑:程序博客网 时间:2024/05/21 10:16

using (DataClasses1DataContext dc = new DataClasses1DataContext())
            {
                using(TransactionScope ts=new TransactionScope(TransactionScopeOption.Required, new TransactionOptions() { IsolationLevel = IsolationLevel.ReadUncommitted }))
                {
                    i=dc.Table_1.Count();
                }
            }

 

这样做实际上是在login的时候加了SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
允许脏读,但并不是加nolcok

原创粉丝点击