Gweaths
Gweaths

Reputation: 85

Why won't my connection string work?

Could someone tell me why my connection string isn't working.. i'm currently using database first, but don't know why it wont connect. Whenever i try i get the error 'The network path was not found'

connection string is: <add name="FactsAndFiguresEntities1" connectionString="metadata=res://*/Models.Model1.csdl|res://*/Models.Model1.ssdl|res://*/Models.Model1.msl;provider=System.Data.SqlClient;provider connection string='data source=SERVERNAME User Id=****; Password = **** catalog=FactsAndFigures;integrated security=True;multipleactiveresultsets=True;application name=EntityFramework'" providerName="System.Data.EntityClient" />

Upvotes: 0

Views: 76

Answers (1)

Shiraz Bhaiji
Shiraz Bhaiji

Reputation: 65391

The error network path not found, could refer to how you are referencing the metadata files. When you use "res://" EF tries to load the metadata from assemblies in the bin catalogue of the application. Do you have a bin catalogue?

Also I notice that you use both Integrated Security=True and Username/password. The system will use one or the other not both.

For details on EF connection strings see: https://msdn.microsoft.com/en-us/library/vstudio/cc716756(v=vs.100).aspx

Upvotes: 1

Related Questions