Click here to Skip to main content
15,889,909 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
When I was trying to Create A Connection to SqlDatabase.
Then 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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
And the connection String:
string str = "Data Source=AJIT-PC/SQLEXPRESS;Initial Catalog=Employee;Integrated Security=True";


Alternatively,I was trying To create a SqlExpress Data base (By right The App_Code Folder and Addind the SqlServer file.
and Then i got This error:
Failed to create a instance of sql server due to closed connection
Posted
Comments
[no name] 15-Jul-15 14:57pm    
Is your Sql server service running? Is it connected to a network? Did you configure remote connections?
PIEBALDconsult 15-Jul-15 15:03pm    
... is the port open?
Member 11804811 15-Jul-15 15:14pm    
I checked Sql server Services is not running.
When I tired To Start the Service .It Give me This error:


computer 'AJIT-PC'. ---> System.ComponentModel.Win32Exception: Access is denied
--- End of inner exception stack trace ---
at System.ServiceProcess.ServiceController.Start(String[] args)
at System.ServiceProcess.ServiceController.Start()
at ReportServicesConfigUI.Panels.ServerInformationPanel.StartStopServiceTask(Boolean start)
[no name] 15-Jul-15 15:21pm    
Well there's your problem then.
PIEBALDconsult 15-Jul-15 15:22pm    
You should use "Improve question" to add that to your question.

1 solution

 
Share this answer
 

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