Exception when trying to setup database connection

1

I am trying to connect with database like

var ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["connStringName"].ConnectionString;
DbCommand dbCommand = db.GetStoredProcCommand("CorrectProcedureName");

using (IDataReader dataReader = db.ExecuteReader(dbCommand))
{
    ...
}

When trying the exception is thrown with message:

The MSDTC transaction manager was unable to pull the transaction from the source transaction manager due to communication problems. Possible causes are: a firewall is present and it doesn't have an exception for the MSDTC process, the two machines cannot find each other by their NetBIOS names, or the support for network transactions is not enabled for one of the two transaction managers. (Exception from HRESULT: 0x8004D02B)"} System.Exception {System.Runtime.InteropServices.COMException}

What I have tried:

  1. "Two machines cannot find each other" - I have tried to connect server by IPv6: it works (I mean: the same exception is thrown as opposed to other random IP's which are totally unaccessible (which is correct because there are no such servers)

  2. "Support for network transactions..." - it is enabled on both machines, checked with administrator

  3. "Firewall is present" - it's not, it's totally disabled

  4. Distributed Transaction Coordinator service is started

The difference between my solution and any examples may be that I have another database connected in the same program (I need 2 dbs at once).

Do you have any idea why it may happen in this case?

c#
sql-server
windows
asked on Stack Overflow Dec 4, 2017 by Dawid • edited Dec 4, 2017 by marc_s

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0