0

I am trying to switch between DbContext and System.Data.SqlClient as my database connection for my .NET project in Visual Studio.

I have called the SqlConnection object and passed the connection string found in the web.config file as a parameter for its constructor.

When I try to open the session, I get an error

Named Pipes Provider, error: 40 - Could not open a connection to SQL Server.

What's the problem?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Kenny Nguyen
  • 222
  • 2
  • 13
  • @Alexandru-IonutMihai Oddly enough, i followed the same instruction in that post and i noticed I SQL Server MSSQLSERVER service is not there. Was it never started? – Kenny Nguyen Nov 19 '16 at 21:43
  • Please take a look here : https://www.mssqltips.com/sqlservertip/2340/resolving-could-not-open-a-connection-to-sql-server-errors/ – Mihai Alexandru-Ionut Nov 19 '16 at 21:45

0 Answers0