WebService Transaction Error in C#.Net 2.0

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fayazmd
    New Member
    • Jul 2007
    • 41

    WebService Transaction Error in C#.Net 2.0

    Hi,

    I am using Transaction in Web Method fro Deleting a record from DB. I am getting following error.

    Network access for Distributed Transaction Manager (MSDTC) has been disabled. Please enable DTC for network access in the security configuration for MSDTC using the Component Services Administrative tool.

    My code is

    Code:
    [WebMethod(TransactionOption=TransactionOption.RequiresNew)]
        public void DeleteStudents(int StudentId)
        {
            try
            {
                SqlCommand cmd = new SqlCommand();
                cmd.CommandText = "DELETE FROM Table WHERE Column = " + StudentId;
                cmd.Connection = conn;
                conn.Open();
                cmd.ExecuteNonQuery();
                conn.Close();
            }
            catch (Exception Ex)
            {
            }
        }
    What should i do now.
    Last edited by Curtis Rutland; Aug 16 '08, 04:04 PM. Reason: Added code tags -- Please use the # button
Working...