Multiple instance on SQL server 2017 with VS 2019.... ERROR 26 on Visual Studio

  • I have a system with multiple clients and each one in different virtual machines, I have proposed the task of joining all the clients in the same virtual, of course taking into account that they are all in the same version of sql server. my first tests failed as i installed each of the instances and was able to each customer database separately. When running the program from visual studio, I was having trouble viewing the reports due to problems with the connection chain. In the following tests I tried to install an instance of client A and make the connections with visual studio and when I ran the program by calling from the desktop it runs wonders and I can see all the reports from it, so the installation works. then I continued to create the instance of client b and everything seems correct until I run the program only from visual studio and it sends me error 26, problem with connection to the server or network. because it does not send me this error in the instance of the client a and only in the b and consequent ones. the strings are fine, the files are where I point them to look, the databases work and make their connections to the server, but my program simply does not run even from the visual studio. I need help!!!!

    Adap_0001.FillByCompa(DataSet99.I0001, ultraComboEmpresa.Value.ToString());


    • This topic was modified 1 month ago by  Charitto95.
  • Thanks for posting your issue and hopefully someone will answer soon.

    This is an automated bump to increase visibility of your question.

  • Without seeing your setup, the full text of the error message, or knowing anything about the setup, I am making a LOT of assumptions below.

    But if I remember right, error 26 means that it couldn't find the instance.  This would lead me to believe that either your connection string is bad, the instance failed to start (and thus isn't listening for connections), or your firewall is blocking the port.  Since you have 2 instances on the same machine, at least 1 of them is a named instance and isn't listening on the default port.  If the SQL browser service isn't running, you would need to provide the port number in your connection string.

    The piece of .NET code you provided is not helpful because it is not a native function call.  That function is private to your project.  What you posted tells us nothing about any of the objects except that the function FillByCompa takes 2 arguments.  But we have no knowledge on what Adap_0001 is as an object, what DataSet99 is except that it has a field called I0001 which we know nothing about either, and same thing with ultraComboEmpresa.  That is likely not the place where things are failing, but inside that function.

    I would start by looking at your connection string and trying to connect to the instances using SSMS from the same machine that you are running visual studio on to confirm that your machine can see the instance.  Once you get that part working, then work on fixing the connection string.

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!

  • Hi Mr. Brian, finally i found the answer and was a total silliness... when passing a database from an old virtual to a new one, old files remain where the old virtual is called where it used to be originally ... so I locate each file with that line and delete some and others change the name of the new virtual machine. Done. everything was fine, it was just reminding my system that it is in a new environment. and they run 6 instances of sql in a virtual one without any problem.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply