Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
i developed a database using c# and SqlServer 2008 ....

i make an exe setup and installed in another computer this time i install sqlexpress edition
i import the data file but when i run the application i got the following error..

SQL
System.Data.SqlClient.SqlException: 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)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
Posted

The server was not found or was not accessible.
To solve the problem, you should
Verify that the instance name is correct and that SQL Server is configured to allow remote connections.
 
Share this answer
 
Comments
abdul manan 7 9-Apr-14 6:04am    
where to check instance name and how to allow remote connections
Schatak 9-Apr-14 6:11am    
Try this link

http://blogs.msdn.com/b/walzenbach/archive/2010/04/14/how-to-enable-remote-connections-in-sql-server-2008.aspx
Get your SQl Instance Name:

SQL
SQL Server Instance Name :

In SQL Server Management Studio->RegisterServers->double click your server to open the Object Explorer -> right click to select the properties window ->General Tab - to see the ServerName (instance name)



or Open a new query in SQL Server Management window  and execute the following

-- to get the sql server instance name

select @@ServerName
 
Share this answer
 
Comments
abdul manan 7 9-Apr-14 6:14am    
Thanks for your reply but this is express edition of sql server
all i have is
import and export data
sql server configuration manager
sql server error and usage reporting
sql server instilation server

there is no sql server management studio
King Fisher 12-Apr-14 8:50am    
http://www.microsoft.com/en-in/download/details.aspx?id=7593


install management studio
Er. Puneet Goel 9-Apr-14 6:22am    
First go to Start >> Run >> CMD (Open command prompt). Once in command prompt run following command based on SQL Server version installed on local machine.

For SQL Server 2000:
C:\> isql -L

For SQL Server 2005 / SQL Server 2008:
C:\> osql -L
OR
C:\> sqlcmd -L

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