开发者

SqlConnection.open() throws TransactionException 0xe0434f4d

开发者 https://www.devze.com 2022-12-17 22:52 出处:网络
Code works fine when connecting to a sql server 2005 dbase.but when connecting to a sql server 2008 dbase it fails.

Code works fine when connecting to a sql server 2005 dbase. but when connecting to a sql server 2008 dbase it fails.

scenario: Webservice first connects to 2008 dbase fine. Then during a call in a COM+ object, the connect fails.

Recently upgraded projects to use VS2008 and upgraded to Sql Server 2008.

using (TransactionScope transactionScope = new TransactionScope(TransactionScopeOption.Required, transactionTimeOut))
{     
   using (SqlConnection sqlConnection = new SqlConnection(DataConnection))
   {
      try
      {
 String command = "my_StoredProcedure";

 using (SqlCommand sqlCommand = new SqlCommand(command, sqlConne开发者_如何学JAVAction))
 {
             sqlConnection.Open();  //- exception is throw right after this call in the COM+ object.

Any Ideas out there?


It looks like you are missing handling a SQLException

http://blogs.msdn.com/tess/archive/2006/04/27/584927.aspx


In my case, binaries deployed to many PC's in network were executed fine except of few machines. All exceptions in code were handled but despite of that, 0xe0434f4d was thrown right after start. The app always was launched locally (not from network share), no obvious issues with permissions etc. The app had .NET 3.5 among its requirements.

I examined installed .NET version (well-known registry subtree HKLM\SOFTWARE\NET Framework Setup\NDP) and found that subkey v3.5\SP (ServicePack) is NOT at 1. It means that .NET 3.5 is installed, but not the latest released version (SP1). After downloading v3.5 SP1, installing and restarting the PC, the entire problem disappeared. So the key was "not just any .NET 3.5, but latest .NET 3.5 must be present".

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号