Error - “The server was not found or was not accessible” when trying to connect to sql server database

前端 未结 2 384
旧时难觅i
旧时难觅i 2021-01-25 13:37

I\'m working on a local project and trying to connect to a local database. I have this class in it the connection string:

public class SQLConnection
{
    public         


        
相关标签:
2条回答
  • 2021-01-25 13:58

    Enable remote connections for SQL Server Express 2012 Most common problems are: 1) Your sql server express is not running. Check it in "sql server configuration manager" 2) server runs but don't allow remote connection. Use sql management studio to configure it.

    0 讨论(0)
  • 2021-01-25 14:10

    A good (and easy) way to test if your SQL connection is working is to use a .UDL file. Simply create an empty text (.txt) file on your desktop and rename the extension to .udl. Double click and you'll be presented with a SQL connection window, fill in the details, test connection and then (when it's working) save. Close the window and rename the file extension to .txt. Open and inside you'll find your working connection string.

    0 讨论(0)
提交回复
热议问题