How to solve error 26: Server / instance localization error specified in the production environment?

I have a strange error in a production environment, but not in a development environment. In my development environment, with Visual Studio 2010, I can connect to Sql Server 2012 without problems. When I copy my Windows Form application to other computers on the same network, I get the error message "Error 26: Local server / error instance" .

The same application did an excellent job with the old database instance with Sql Server 2008. I don’t know what to check and where to start!

EDIT: Another weird behavior is that it works well if I use code like this

conn.Open() dr = cmd.ExecuteReader() 

But stop working if I open the form with datagridview, dataset and BindingSource!

+7
source share
1 answer

this blog post contains detailed error 26 information.

From the post:

In short, the reason we get this error message is because the client stack could not receive the UDP SSRP response packet from SQL Browser. It’s easy to highlight the problem. Here are the steps:

  • Make sure your server name is correct, for example, there is no typo on the name.
  • Make sure your instance name is correct and there is such an instance on your target computer. [Update: some application converts \ to. If you are unsure of your application, try using Server \ Instance and Server \\ Instance in the connection string]
  • Make sure that the server server is accessible, for example, DNS can be resolved correctly, you can execute a ping server (not always true).
  • Verify that the SQL Browser service is running on the server.
  • If the firewall is enabled on the server, you need to put sqlbrowser.exe and / or UDP port 1434 in the exception.

Once everything is done, you will not see this error message anymore. You can still not connect your SQL server, but the error message should be different, and now you have a different problem. [Update. If all else fails, you can replace server \ instance with tcp: server \ instance and / or np: server \ instance and see if it succeeds with TCP or NP. That way you can a little bit. ]

+5
source

All Articles