Click here to Skip to main content
15,888,205 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi everybody,
I have an asp.net page that retrieves data from sql server2008 on server,
I had done all the necessary steps which are required to access database on a network.

But when i run my application it gave me error like

'A network-related or instance-specific error occurred while establishing a connection to SOL 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)'

Please help me in this regard

:(
Mehboob
Pakistan
Posted
Updated 22-Jun-10 4:15am
v2

1 solution

Obviously you need to check the connection string. Are you using a DNS name? Verify the name can be resolved. Using an IP address? Verify the address can be contacted. Ensure the SQL server instance is configured properly for remote connections
 
Share this answer
 
Comments
Member 4178850 22-Jun-10 10:35am    
Sir i had the following connection in my web.config,oso the remote connection is allowed by default in sql server2008
add name="AddressBookConnectionString" connectionString="Data Source=213.164.63.62;Initial Catalog=AddressBook;Integrated Security=False;Connect Timeout=60;User ID=AddressBook;Password=pa$$w0rd"
providerName="System.Data.SqlClient"

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900