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
What should i do now.
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)
{
}
}