开发者

Connection error in sql server 2005

开发者 https://www.devze.com 2022-12-17 15:31 出处:网络
I have a problem,I run applicationC# and I get a error \"A network-related or instance-specific error occurred while

I have a problem,I run application C# and I get a error

"A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (p开发者_运维百科rovider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

??? what? thanks


The error message pretty much says it all: make sure the instance name is correct (if your SQL server is using instances) and make sure your server is configured to allow remote connections.

How to configure SQL Server to allow remote connections

How to connect to a server instance


Tip for troubleshooting your connection string:

  • Create a file named "testconnect.udl".

  • Double click the newly created file.

  • On the "Data Link Properties" dialog Switch to first tab "Provider".

  • From the list of providers select "SQL Native Client".

  • Click "Next>>".

  • Complete the following information according to your desired connection:

    1. Data Source // your server name

    2. User Name + Password; check "Allow saving passwords"

    3. Initial catalog // your database name

  • Click "Test connection".

If the connection succeeds save the database link, clicking "OK".

Open the testconnect.udl file with a text editor of your choice and compare the information with your application connection string.


Check the protocols that are enabled for your server.
Run the Configuration Manager; you may need to enable TCP/IP.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号