本文介绍了System.InvalidOperationException'发生并被捕获的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞!我们正在将.net 3.5与sqlserver 2012一起使用,并间歇性地遇到错误. Type:System.InvalidOperationException,mscorlib,Version = 2.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089消息:由于连接已断开,无法完成请求的操作.资料来源:System.Data帮助链接:数据:System.Collections.ListDictionaryInternalTargetSite:无效ExecuteTransaction(TransactionRequest,System.String,System.Data.IsolationLevel,System.Data.SqlClient.SqlInternalTransaction,Boolean)堆栈跟踪: at System.Data.SqlClient.SqlInternalConnectionTds.ExecuteTransaction(TransactionRequest transactionRequest,字符串名称,IsolationLevel iso,SqlInternalTransaction internalTransaction,布尔值isDelegateControlRequest) at System.Data.SqlClient.SqlDelegatedTransaction.Initialize() at System.Transactions.TransactionStatePSPEOperation.PSPEInitialize(InternalTransaction tx,IPromotableSinglePhaseNotification promotableSinglePhaseNotification) at System.Transactions.TransactionStateActive.EnlistPromotableSinglePhase(InternalTransaction tx,IPromotableSinglePhaseNotification promotableSinglePhaseNotification,Transaction atomicTransaction) at System.Transactions.Transaction.EnlistPromotableSinglePhase(IPromotableSinglePhaseNotification promotableSinglePhaseNotification) at System.Data.SqlClient.SqlInternalConnection.EnlistNonNull(Transaction tx) at System.Data.SqlClient.SqlInternalConnection.EnlistTransaction(交易事务) at System.Data.SqlClient.SqlConnection.EnlistTransaction(交易事务) at System.Data.Linq.SqlClient.SqlConnectionManager.UseConnection(IConnectionUser用户) at System.Data.Linq.SqlClient.SqlProvider.get_IsSqlCe() at System.Data.Linq.SqlClient.SqlProvider.InitializeProviderMode() at System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(表达式查询) at System.Data.Linq.Table`1.GetEnumerator() at System.Data.Linq.Table`1.System.Collections.Generic.IEnumerable< TEntity> .GetEnumerator() at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) at System.Linq.Enumerable.ToList [TSource](IEnumerable`1源)解决方案We are using .net 3.5 with sqlserver 2012 and getting below error intermittently.Type : System.InvalidOperationException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089Message : The requested operation cannot be completed because the connection has been broken.Source : System.DataHelp link : Data : System.Collections.ListDictionaryInternalTargetSite : Void ExecuteTransaction(TransactionRequest, System.String, System.Data.IsolationLevel, System.Data.SqlClient.SqlInternalTransaction, Boolean)Stack Trace : at System.Data.SqlClient.SqlInternalConnectionTds.ExecuteTransaction(TransactionRequest transactionRequest, String name, IsolationLevel iso, SqlInternalTransaction internalTransaction, Boolean isDelegateControlRequest) at System.Data.SqlClient.SqlDelegatedTransaction.Initialize() at System.Transactions.TransactionStatePSPEOperation.PSPEInitialize(InternalTransaction tx, IPromotableSinglePhaseNotification promotableSinglePhaseNotification) at System.Transactions.TransactionStateActive.EnlistPromotableSinglePhase(InternalTransaction tx, IPromotableSinglePhaseNotification promotableSinglePhaseNotification, Transaction atomicTransaction) at System.Transactions.Transaction.EnlistPromotableSinglePhase(IPromotableSinglePhaseNotification promotableSinglePhaseNotification) at System.Data.SqlClient.SqlInternalConnection.EnlistNonNull(Transaction tx) at System.Data.SqlClient.SqlInternalConnection.EnlistTransaction(Transaction transaction) at System.Data.SqlClient.SqlConnection.EnlistTransaction(Transaction transaction) at System.Data.Linq.SqlClient.SqlConnectionManager.UseConnection(IConnectionUser user) at System.Data.Linq.SqlClient.SqlProvider.get_IsSqlCe() at System.Data.Linq.SqlClient.SqlProvider.InitializeProviderMode() at System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query) at System.Data.Linq.Table`1.GetEnumerator() at System.Data.Linq.Table`1.System.Collections.Generic.IEnumerable<TEntity>.GetEnumerator() at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source) 解决方案 这篇关于System.InvalidOperationException'发生并被捕获的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-05 22:26