title: Understanding how transaction.complete function?
body: <p>Hi All we have started to use transaction scope and below is the code snippet. What we need to understand is based on our understading after each of the using for connection the particular connection will be disposed/closed right? So since its closed how does the transaction.complete works?</p>
  
  <pre><code>using (TransactionScope transScope = new TransactionScope())
  {
     try
     {
        string myConnStringLocal = "User Id=***;Password=****;Host=" + globalSettings.settingLocalIP + ";Database=" + globalSettings.settingLocalDB;
        using (MySqlConnection connectionLocal = new MySqlConnection(myConnStringLocal))
        {
           try{
           connectionLocal.Open();
           }
           Catch(Exception e)
           {
  
           }
           finally{
           connectionLocal.Close();
           }
        }
  
        string myConnStringCentral = "User Id=***;Password=*****;Host=" + globalSettings.settingCentralIP + ";Database=" + globalSettings.settingCentralDB;
        using (MySqlConnection connectionCentral = new MySqlConnection(myConnStringCentral))
        {
           try{
           connectionCentral.Open();
           }
           Catch(Exception e)
           {
  
           }
           finally{
           connectionCentral.Close();
           }
  
        }
        string myConnStringCentralCopy = "User Id=*****;Password=*****;Host=" + globalSettings.settingCentralCopyIP + ";Database=" + globalSettings.settingCentralCopyDB;
        using (MySqlConnection connectionCentralCopy = new MySqlConnection(myConnStringCentralCopy))
        {
           try{
           connectionCentralCopy.Open();
           }
           Catch(Exception e)
           {
  
           }
           finally{
           connectionCentralCopy.Close();
           }
        }
        transScope.Complete();
        Console.WriteLine("Transaction is completed");
     }
     catch (Exception)
     {
        Console.WriteLine("Transaction is rolled back");
     }
  }
  </code></pre>