I have a c# project with SQL Server 2008 R2 and the project runs with no problem in local and I publish it to the server Win2008 R2. But the project doesn't work and can't connect to the server with no error. All the database setting check and I enabled
TCP/IP setting and etc. But still not worked. I think the problem is with connection string that is below.
When pages going to connect to the database, nothing happend in browser and browser stick in loading mode (waiting for respond).
Connection String In My Computer
public static string ConnectionString = "Data Source =(Local);Initial Catalog=Bulk;Integrated Security=True;Timeout=0;Max Pool Size=5000;";
Connection String In Windows Server
public static string ConnectionString = "Data Source=My Ip Windows Server,1433;Network Library=DBMSSOCN;Initial Catalog=Bulk;User ID=administrator;Password=My Windows Login Pass;Timeout=0;Max Pool Size=5000;";
I got this 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. (provider:
SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified
Thanks for your post. As per this case, I am suspecting that the issue might be caused by connection string.
Moreover you can try like below :
public static string ConnectionString = "Provider=SQLOLEDB;Data Source=My Ip Windows Server,1433;Network Library=DBMSSOCN;Initial Catalog=Bulk;User ID=administrator;Password=My Windows Login Pass;Timeout=0;Max Pool Size=5000;";
Or
public static string ConnectionString = "Provider=MSDASQL;Data Source=My Ip Windows Server,1433;Network=DBMSSOCN;Initial Catalog=Bulk;User ID=administrator;Password=My Windows Login Pass;Timeout=0;Max Pool Size=5000;";
public static string ConnectionString = "Data Source=My Ip Windows Server,1433;Network Library=DBMSSOCN;Initial Catalog=Bulk;User ID=administrator;Password=My Windows Login Pass;Timeout=0;Max Pool Size=5000;";
Why are you using Your windows login password. Use SQL Server login password instead of your windows login password.
Member
1 Points
14 Posts
Unable connect to SQL server 2008
Jun 06, 2015 07:16 AM|noth50|LINK
I have a c# project with SQL Server 2008 R2 and the project runs with no problem in local and I publish it to the server Win2008 R2. But the project doesn't work and can't connect to the server with no error. All the database setting check and I enabled TCP/IP setting and etc. But still not worked. I think the problem is with connection string that is below.
When pages going to connect to the database, nothing happend in browser and browser stick in loading mode (waiting for respond).
Connection String In My Computer
Connection String In Windows Server
I got this 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. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified
server asp sql
Member
260 Points
66 Posts
Re: Unable connect to SQL server 2008
Jun 07, 2015 10:56 PM|kittyboy|LINK
Thanks for your post. As per this case, I am suspecting that the issue might be caused by connection string.
Moreover you can try like below :
public static string ConnectionString = "Provider=SQLOLEDB;Data Source=My Ip Windows Server,1433;Network Library=DBMSSOCN;Initial Catalog=Bulk;User ID=administrator;Password=My Windows Login Pass;Timeout=0;Max Pool Size=5000;";
Or
public static string ConnectionString = "Provider=MSDASQL;Data Source=My Ip Windows Server,1433;Network=DBMSSOCN;Initial Catalog=Bulk;User ID=administrator;Password=My Windows Login Pass;Timeout=0;Max Pool Size=5000;";
Reference link : https://www.connectionstrings.com/define-sql-server-network-protocol/
server asp sql
Kittyboy
Contributor
7095 Points
1966 Posts
Re: Unable connect to SQL server 2008
Jun 08, 2015 01:44 AM|anuj_koundal|LINK
Why are you using Your windows login password. Use SQL Server login password instead of your windows login password.
server asp sql
Asp .Net Tutorials | www.codingfusion.com
Bank IFSC Codes
Ajax Control Toolkit