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

前端 未结 2 383
旧时难觅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 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.

提交回复
热议问题