Named Pipes Provider, error: 40 - Could not open a connection to SQL Server 2008 in .net application [closed]
I am using .net application by sql server 2008 remote access. The error in application are "An error occurred while establishing a connection to server. When connecting to SQL Server 2008, this failure may caused by the fact that under the default settings SQL Server does not allow remote connections. (Provider:Named pipes Provider error:-40 - Could not open a connection to sql server.
Your SQl server is ether doesn't allow your remote access so if you want to access remote server allow tcp/ip connections or your connection string is wrong. In either case you should post your connection string without servername username password in here so we can check the validity.
Just one note, allowing external tcp/ip connections to SQL-SERVER is not secure because anyone can access the server from now on. I would advice to limit access in firewall or managed switch by restricting access to IIS or application server IP.
精彩评论