Last post Feb 20, 2014 08:55 PM by Topspy
Feb 18, 2014 02:11 PM|kiranmayi.kandula|LINK
My connection string was working fine when using IIS Express. Now after moving to IIS. I'm getting error as
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: Named Pipes Provider, error: 40 - Could not open
a connection to SQL Server)
Not able to figure out the reason for this.
Feb 18, 2014 02:55 PM|smiling4ever|LINK
You cannot use SqlExpress db in your hosting account. You have to create db through your hosting account (server) and to connect into that after deploying the database.
For connectionstrings reference check the following URL:
Feb 18, 2014 06:26 PM|kiranmayi.kandula|LINK
I'm using SQL Server 2005 not SQLExpress. The database is on a remote server.
Feb 19, 2014 02:34 AM|Starain chen - MSFT|LINK
According to your description, I would like to know do the IIS Express and IIS in the same machine.
Please provide your connectionstring.
On the other hand, please refer to this link:
Feb 19, 2014 03:01 PM|kiranmayi.kandula|LINK
yes both IIS and IISExpress are on the same machine.
name="myConnectionString" connectionString="Persist Security Info=False;User ID=userid;Password=password;Initial Catalog=mydatabase;Data Source=myserver"/>
tried with IP address also.
Feb 19, 2014 10:40 PM|Starain chen - MSFT|LINK
Please try to use the connectionString like this:
Data Source=184.108.40.206,1433;Network Library=DBMSSOCN;
Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;
Feb 19, 2014 11:09 PM|sumoncse12|LINK
Please check that your SQL server is allowing TCP/IP and port is correct.
You can use connection string like
<add name="userDbConnectionString" connectionString="Data Source=XXX.XXX.XXX.XXX;Initial Catalog=YourDB;user id= sa; password =sa" providerName="System.Data.SqlClient"/>
Feb 20, 2014 08:55 PM|Topspy|LINK
Since your database is on live production server, you should check if your hosting server is blocking the connection. Maybe you have to contact hosting support for assistance.