当前位置:数据库 > SQLServer >>

EXTASPNET C# ASP.NET sql server 事务超时,解决方法

[csharp]
private bool SaveAll() 
       { 
           <span style="color:#ff0000;">TransactionOptions transactionOption = new TransactionOptions();  
           transactionOption.Timeout = new TimeSpan(0, 0, 600); 
           using (TransactionScope tscope = new TransactionScope(TransactionScopeOption.Required, transactionOption))</span> 
           { 
               using (SharedDbConnectionScope scope = new SharedDbConnectionScope()) 
               { 
                   try 
                   { 
                       //语句 
                       tscope.Complete(); 
 
                       return true; 
                   } 
                   catch (Exception Ee) 
                   { 
                       tscope.Dispose(); 
                       logger.Warn(string.Format("错误:错误描绘“{0}”", Ee.Message)); 
                       return false; 
                   } 
               } 
           } 
       } 
作者:dxh_0829
补充:Web开发 , ASP.Net ,
Oracle
MySQL
Access
SQLServer
DB2
Excel
SQLite
SYBASE
Postgres
如果你遇到数据库难题:
请访问www.zzzyk.com 试试
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,