title: Single sql transaction on multiple method
body: <p>Modular programing is right approach but it sometimes lead to problem which needs extra efforts and research. I have three database insert function like <code>InsertName(),InsertAddress(),InsertPhoneNo()</code> take it as example. All these functions must execute if exception occurs in any of function no change will be made to database .</p>
  
  <p>What I can do is merge all three in one and use sqltransaction.</p>
  
  <pre><code>InsertDetails()
  {
  using (SqlTransaction sqlTransaction = cn.BeginTransaction()) 
      {
        using (SqlCommand cm = new SqlCommand()) 
        {
          cm.Transaction = sqlTransaction;
          InsertName();//Code to insert name   
          Insertaddress();//code to insert address
          InsertPhoneNo();//code to insert phone no
        }
        sqlTransaction.Commit();
      }
  }
  </code></pre>
  
  <p>but the solution above is against my modular approach. Is it possible to bind multiple functions to one sql transaction without merging them , If not which is the best approach possible to achieve this.</p>