Transactions in .net

Transction processing .net.
SqlConnection con = new SqlConnection(myConnStr);
SqlTransaction transaction;

      con.Open();
      transaction = con.BeginTransaction();
      try 
      {
         new SqlCommand(mySQLQuery1111, con, transaction)
            .ExecuteNonQuery();
         new SqlCommand(mySQLQuery1222, con, transaction)
            .ExecuteNonQuery();
         
         transaction.Commit();
      } 
      catch (SqlException sqlError) 
      {
         transaction.Rollback();
      }
      db.Close();

Error handling in Ajax

1) Add On "AsyncPostBackError" event on the scriptmanager 2)Implement the event on the server and set AsyncPostBackErrorMessage of scriptmgr ScriptManager1.AsyncPostBackErrorMessage = "Error Text"
<asp:ScriptManager ID="ScriptManager1" runat="server" OnAsyncPostBackError="ScriptManager1_AsyncPostBackError"> </asp:ScriptManager>
protected void ScriptManager1_AsyncPostBackError(object sender, AsyncPostBackErrorEventArgs e)
{
    if (e.Exception.Data["ExtraInfo"] != null)
    {
        ScriptManager1.AsyncPostBackErrorMessage =
            e.Exception.Message +
            e.Exception.Data["ExtraInfo"].ToString();
    }
    else
    {
        ScriptManager1.AsyncPostBackErrorMessage =
            "An unspecified error occurred.";
    }
}
http://www.asp.net/AJAX/Documentation/Live/tutorials/CustomizingErrorHandlingforUpdatePanel.aspx