Why am I getting this error when I try to open the MDF database via path / filename in the Entity Framework?

I am moving the application from LINQ-to-SQL to the Entity Framework and changed the line:

using (var db = new MainDataContext(SystemHelpers.GetDatabaseConnectionString()))

to

using (var db = new MainDataEntities(SystemHelpers.GetDatabaseConnectionString()))

where SystemHelpers.GetDatabaseConnectionString())is the path to the .mdf file .

It works in LINQ-to-SQL, but in the Entity Framework the above line gives me this error :

Initialization format is a string conflict with a specification starting with '0';

which is the best translation I can do from German:

"Das Format der Initializing Stimulator nicht mit der Spezifikation überein, die bei Index '0' beginnt."

0
2

Entity Framework , .

:

  • = > ,
  • = > , EF CSDL, MSL SSDL (.. , Mapping and Storage Model)
  • = > SQL System.Data.SqlClient

:

metadata = res:///Model.csdl | res:///Model.ssdl | res://*/Model.msl; = System.Data.SqlClient; = " =.\SQLEXPRESS; = ; = ; = False; MultipleActiveResultSets = True"

,

+2

EF DB. DB, . , DB. . . EF.

+1

Source: https://habr.com/ru/post/1722461/


All Articles