c# - The underlying provider failed on Open in entity framework connection -


i use entity framework in .net 4 , use connection in project:

<add name="database1entities" connectionstring="metadata=res://*/model.model1.csdl|res://*/model.model1.ssdl|res://*/model.model1.msl;provider=system.data.sqlclient;pr  ovider connection string=&quot;data source=.\sqlexpress;attachdbfilename=|datadirector  y|\database1.mdf;initial catalog=database1;integrated security=true;user instance=true;multipleactiveresultsets=true&quot;" providername="system.data.entityclient" /> 

and show error:

the underlying provider failed on open.

i don't know why error use connection string , don't have problem. remember name of dbcontext class , connection string should same

<add name="mydb"      connectionstring="server=127.0.0.1;user id=sa;password=password;database=database"      providername="system.data.sqlclient"/> 


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -