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.
using (System.Transactions.TransactionScope ts = new System.Transactions.TransactionScope())
11 {
12 try
13 {
14 foreach (DataRow row in this.dt1.Rows)
15 {
16 int titleId = int.Parse(row["titleId"].ToString());
17 string fname = row["fname"].ToString();
18 string lname = row["lname"].ToString();
19
20 if (cmd.Parameters.Count > 0)
21 cmd.Parameters.Clear();
22
23 cmd.Parameters.AddWithValue("@titleId", titleId);
24 cmd.Parameters.AddWithValue("@fname", fname);
25 cmd.Parameters.AddWithValue("@lname", lname);
26 cmd.ExecuteNonQuery();
27
28 }
29 con.Close();
30 ts.Complete();
31 }
32 catch (Exception ex)
33 {
34
35 }
36 }
37 }
InnerException = {"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."}
I followed the below steps to resolve above issue on my local system
Enable Network DTC Access :
Run dcomcnfg in start to open the Component Services Administrative tool
Click on Local DTC and open the property window
Click on security Tab and make below security settings to enable Network DTC Access
Enabled Firewall Rules related to Distributed Transaction Coordinator (TCP-IN/TPC-
For more details @https://rajeevdotnet.blogspot.com/2018/10/wcf-exception-network-access-for.html