0

I got a C# program installed in 5 different machines, pointing to the same database, running at the same time. The database is running on Machine A. 3 machines are running Windows Server 2016 (including A) and others are running Windows 10. None of them are virtual.

I am using 3 different connection strings:

  1. connectionString="Data Source=SERVERNAME\INSTANCENAME;Initial Catalog=myDataBase;Persist Security Info=True;User ID=myUsername;Password=myPassword - used on machine A (Windows Server 2016)
  2. connectionString="Data Source=IP\INSTANCENAME;Initial Catalog=myDataBase;Persist Security Info=True;User ID=myUsername;Password=myPassword - used on 1 Windows Server 2016 machine
  3. connectionString="Data Source=IP\PORT;Initial Catalog=myDataBase;Persist Security Info=True;User ID=myUsername;Password=myPassword - used on all other machines

Sometimes this error shows up while trying to insert data into the database. The "Maximum number of concurrent connections" on SQL Server Management Studio is set to unlimited and all machines have different names.

Error

Miguel Mesquita Alfaiate
  • 2,851
  • 5
  • 30
  • 56
Bruno
  • 57
  • 1
  • 9
  • 3
    The error you say you get in the title and that image are not the same. We already, however, have a canonical duplicate for that error: [Why am I getting “Cannot Connect to Server - A network-related or instance-specific error”?](https://stackoverflow.com/q/18060667/2029983) – Thom A Sep 03 '20 at 11:59
  • Have you tried to restart **all** machines _after_ assigning them their IP address? – THEoneANDonly Sep 03 '20 at 12:00
  • Do the different clients have the same hostname and/or IP though? If so, that will poet a problem. Both Hostnames and IPs should be unique within the same network. – Thom A Sep 03 '20 at 12:03
  • @Larnu None of the machines have the same hostname or IP. – Bruno Sep 03 '20 at 12:14
  • 1
    If you open a Command Prompt on one of the servers and run `nbtstat -n` do you get any duplicate names listed? – AlwaysLearning Sep 03 '20 at 22:31
  • @AlwaysLearning I tested it on all machines and i got no duplicate names – Bruno Sep 04 '20 at 08:16

0 Answers0