views:

394

answers:

1

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, sqlConnection))
 {
             sqlConnection.Open();  //- exception is throw right after this call in the COM+ object.

Any Ideas out there?

A: 

It looks like you are missing handling a SQLException

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

taspeotis
I have a catch for SQLException, but this type of exception is not thrown. It is of type TransactionException.
Larry
specifically, it is a System.Transactions.TransactionException.Drilling down in it ends with _COMPlusExceptionCode = 0xE0434F4D
Larry
Created UnhandledExceptionModule and added to web.config.Ran my code, and same results, with no entry in the Application event log. Same System.Transactions.TransactionException thrown.
Larry

related questions