简体   繁体   中英

How to test MSSQL Database Connectivity outside an application

Sometimes when trying to setup web.config and connectionstrings.config settings for our .NET applications we get DB errors. Many times due to wrong connection info in the config files. Sometimes we need to find out if the app/web server can even see the DB server.

How would you connect to your DB server to test connectivity before getting the app to run?

The answer that I have found is this:

There's a utility built into windows that will test SQL connections. Here's a simple way to use it.

Create an empty file called anything.udl and double click on it. Click the Provider tab, and select "Microsoft OLE DB Provider for SQL Server". Then click the connection tab, populate your connection details, and hit the "Test Connection" button.

Credit goes to this poster/forum about 3 posts down they post the above information.

So steps to do so are the following:

  1. On your app/web server create a blank file called test.udl
  2. Double-click this file and at least with Windows Server 2008 R2 it will open up a Data Link Properties window.
  3. Insert your connection string information and hit the test button and it should connection successfully. If it doesn't then make sure your DB info is correct and if it is then your server might not be able to see the SQL server.

Hope this is helpful to others!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM