A network-related or instance-specific error occurred when applicatoin connect to a DB

Source: Internet
Author: User
Tags connectionstrings

The error as following:

Symptom:

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. (provider: SQL network interfaces, error: 26-error locating server/instance specified)

Cause:

Application log on DB with a instance which is denied or unaccessable.

Solution:

To resolve the issue-I had to change the vsts options; from tools-> options-> data tools-> data connection, then set SQL serevr Instance name as blank or an instance name you want.

For example, this paragraph is from a config file, the server is "./", that means a local server, default instance.

If application need to connect to sqlexpress instance, it shocould be... Server =./sqlexpress. Accordingly, you shocould update the "SQL serevr Instance name" in vs also.

<Connectionstrings>
<Add name = "sinadb"
Connectionstring = "Server =./; database = shotgunaccept; Integrated Security = sspi ;"
Providername = "system. Data. sqlclient"/>
</Connectionstrings>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.