开发者

Error when connect to remote SQL Server

开发者 https://www.devze.com 2023-04-13 07:56 出处:网络
I try to connect to remote SQL Server 2008 Express database from my ASP.NET web application but error throws:

I try to connect to remote SQL Server 2008 Express database from my ASP.NET web application but error throws:

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 c开发者_如何学编程orrect and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

How to resolve that problem. Thanks!


Here's the first thing to check. By default Express only has the shared memory protocol enabled. You'll need to enable TCP/IP protocol for the service (SQLEXPRESS). You do this through the SQL Server Configuration Manager.

Also since Express is a named instance, you'll need to ensure that the SQL Server Browser service is started.

Make sure your connection string is correct. When you are hitting a named instance (SQLEXPRESS in this case) you need to have the data source as yourServer\sqlexpress.

And not to mention, make sure you can ping the box that houses the instance.

Check those things out and let me know if that still doesn't fix it.


i thing your connection string is not correct. Also check a named instance you try to data source as IPaddress\sqlexpress. Like 000.000.000.000\SqlExpress

0

精彩评论

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

关注公众号