Do you support MSDTC service?

Programming, error messages and sample code > ASP.NET

What is MSDTC

MSDTC, Microsoft Distributed Transaction Coordinator, is essentially, as name suggests, a coordinator/manager to handle transactions that are distributed over multiple machines. Let’s say we start a transaction, where one of the steps includes querying data from a different Sql Server instance on a different physical machine; MSDTC comes into action with these specific tasks that need transaction coordination across different physical machines. It executes the section of code that is supposed to run on remote machines and brings back the results to local Sql instance. In this process, if any issue were to occur, on the remote machine that results in rollback, MSDTC makes sure the original transaction on this machine also rolls-back safely.

Do you support MSDTC

Yes, msdtc is supported in our semi plans.

How to use MSDTC

Below is a demo to test MSDTC:
<% @Page Language="C#" %>
<% @Import Namespace="System.Transactions" %>
<% @Import Namespace="System.Data" %>
<% @Import Namespace="System.Data.SqlClient" %>
<% @Import Namespace="System.Text" %>

<script runat="server">
   protected void Page_Load(object sender, EventArgs ea)
            using (TransactionScope scope = new TransactionScope())
                  SqlConnection conn = new SqlConnection("data source=xx;uid=xx;password=xx;database=xx");
                  SqlCommand cmd = new SqlCommand();
                  cmd.Connection = conn;
                  cmd.CommandText = "update ActivityLog set IpAddress='' where Id = 1";
                  SqlConnection conn2 = new SqlConnection("data source=xx;uid=xx;password=xx;database=xx");
                  SqlCommand cmd2 = new SqlCommand();
                  cmd2.Connection = conn2;
                  cmd2.CommandText = "update Address set Email='' where Id = 1";

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

<html xmlns="" >
<head runat="server">
   <form id="form1" runat="server">
     <add assembly="System.Transactions, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089" />