can't instantiate Entities context
Posted: Wed 19 Dec 2012 09:00
Hi,
We just migrate from VS20120 to VS2012, and I our sqlite connector doesn't work anymore. So we migrate to devart sqlite connector (we use trial for now but will probably use team licence if it does the job).
We choosed Database first option, as we already have a database set.
With devart connector, we managed to generate our model. It upgrades our connection string in app.config; like this
But when we try to instantiate our Entities context,
the generated code for our ExpertEntities is :
we got an error :
In french : "Message = "La connexion nommée spécifiée est introuvable dans la configuration, n'est pas destinée à être utilisée avec le fournisseur EntityClient ou n'est pas valide."
We could translate it to : "the named connexion specified is not found in configuration, or is not designed to be used with ENtityClient provider or is not valid.
This code worked with our previous connector, we certainly miss something but we don't know what.
Any advises on this issue ?
Thanks in advance
We just migrate from VS20120 to VS2012, and I our sqlite connector doesn't work anymore. So we migrate to devart sqlite connector (we use trial for now but will probably use team licence if it does the job).
We choosed Database first option, as we already have a database set.
With devart connector, we managed to generate our model. It upgrades our connection string in app.config; like this
Code: Select all
<add name="ExpertEntitiesConnectionString" connectionString="metadata=res://*/Expert.DB.ExpertModel.csdl|res://*/Expert.DB.ExpertModel.ssdl|res://*/Expert.DB.ExpertModel.msl;provider=Devart.Data.SQLite;provider connection string="Data Source=D:\reps\ourdb.s3db""
providerName="System.Data.EntityClient" />
Code: Select all
ExpertEntities ctx = new ExpertEntities();
Code: Select all
/// <summary>
/// Initialize a new ExpertEntities object.
/// </summary>
public ExpertEntities() :
base(@"name=ExpertEntitiesConnectionString", "ExpertEntities")
{
OnContextCreated();
}
In french : "Message = "La connexion nommée spécifiée est introuvable dans la configuration, n'est pas destinée à être utilisée avec le fournisseur EntityClient ou n'est pas valide."
We could translate it to : "the named connexion specified is not found in configuration, or is not designed to be used with ENtityClient provider or is not valid.
This code worked with our previous connector, we certainly miss something but we don't know what.
Any advises on this issue ?
Thanks in advance