1

My entity framework application is not working, every time I start the application I receive :

" The underlying provider failed on Open" excpetion. the inner exception is "server is unreachable"...

I'm using a local sql server and the ConnectionString is correct.(Already tested it in a small console application)

The connection string looks like this:

<add name="Programmeren5Entities" connectionString="metadata=res://*/NinjaDataModel.csdl|res://*/NinjaDataModel.ssdl|res://*/NinjaDataModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=.\DEVELOPMENT;initial catalog=Programmeren5;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />

Here is the part that throws the exception:

var b = new List<Ninja>();
using (var context = new Programmeren5Entities())
{
    b = context.Ninja.ToList();
}
return b;

What could be the reason it doesn't work? The database also has the right format and does have all the columns. I also tried the DTC config solution and checked if the SQL service was running.

Selim Yildiz
  • 5,254
  • 6
  • 18
  • 28
Ferryzijl
  • 642
  • 2
  • 8
  • 22

1 Answers1

0

try this with SQL Authentication

<add name="Programmeren5Entities" connectionString="metadata=res://*    
NinjaDataModel.csdl|res://*/NinjaDataModel.ssdl|res:
//*/NinjaDataModel.msl;provider=System.Data.SqlClient;provider connection 
string=&quot;data source=.\DEVELOPMENT;initial catalog=Programmeren5; persist 
security info=True;user id=sa; password=****; multipleactiveresultsets=True;
App=EntityFramework&quot;" providerName="System.Data.EntityClient" />

MSSQL Error 'The underlying provider failed on Open'

Community
  • 1
  • 1