W
WhiteEagl
Hi,
I have an application that uses a web service to access a
SQLServer database. Theses 3 elements are on seperate
machines.
Part of my webservice looks like this:
[WebMethod(TransactionOption =
TransactionOption.RequiresNew, Description="Specific
Method to Query Table1, Table2 and Table3 from the
database")]
public void SaveTables(DataSetApplication dsApp,
ConnectionMode mode)
{
using (SqlConnection sqlConnection = new SqlConnection
(GetConnectionString(mode)))
{
sqlConnection.Open();
InitializeConnection(sqlConnection);
sqlDataAdapterTable1.Update(dsApp);
sqlDataAdapterTable2.Update(dsApp);
sqlDataAdapterTable3.Update(dsApp);
sqlDataAdapterTable1.Dispose();
sqlDataAdapterTable2.Dispose();
sqlDataAdapterTable3.Dispose();
sqlConnection.Close();
}
}
Then I get the following error:
Exception: System.Web.Services.Protocols.SoapException
Message: Server was unable to process request. -->
MSDTC on server 'SQL03' is unavailable.
My question is, how can I modify the code so that the
transaction is in the code and not used directly on the
DB. (The DBA wont change anything on his side...)
I have an application that uses a web service to access a
SQLServer database. Theses 3 elements are on seperate
machines.
Part of my webservice looks like this:
[WebMethod(TransactionOption =
TransactionOption.RequiresNew, Description="Specific
Method to Query Table1, Table2 and Table3 from the
database")]
public void SaveTables(DataSetApplication dsApp,
ConnectionMode mode)
{
using (SqlConnection sqlConnection = new SqlConnection
(GetConnectionString(mode)))
{
sqlConnection.Open();
InitializeConnection(sqlConnection);
sqlDataAdapterTable1.Update(dsApp);
sqlDataAdapterTable2.Update(dsApp);
sqlDataAdapterTable3.Update(dsApp);
sqlDataAdapterTable1.Dispose();
sqlDataAdapterTable2.Dispose();
sqlDataAdapterTable3.Dispose();
sqlConnection.Close();
}
}
Then I get the following error:
Exception: System.Web.Services.Protocols.SoapException
Message: Server was unable to process request. -->
MSDTC on server 'SQL03' is unavailable.
My question is, how can I modify the code so that the
transaction is in the code and not used directly on the
DB. (The DBA wont change anything on his side...)