Hello, I'm using Entity Framework in my project. The Framework has created its own connection string, so my web.config connectionStrings section file looks following:
<connectionStrings>
<add name="ApplicationServices" connectionString="data source=TEST186;user id=vnkuser;pwd=vnkuser;initial catalog=VNK" providerName="System.Data.SqlClient" />
<add name="VNKEntities" connectionString="metadata=res://*/Models.CMSModel.csdl|res://*/Models.CMSModel.ssdl|res://*/Models.CMSModel.msl;provider=System.Data.SqlClient;provider connection string="Data Source=TEST186;Initial Catalog=VNK;User ID=vnkuser;Password=vnkuser;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" />
</connectionStrings>
The first connection string called ApplicationServices is my original one. The second, called VNKEntities has been created while generating the model.
When I checked the generated *.edmx file, I found that this model is referencing its connection string, which is shown below:
/// <summary>
/// Initializes a new VNKEntities object using the connection string found in the 'VNKEntities' section of the application configuration file.
/// </summary>
public VNKEntities() : base("name=VNKEntities", "VNKEntities")
{
this.ContextOptions.LazyLoadingEnabled = true;
OnContextCreated();
}
My question is how can I get rid of the VNKEntities connection string, and leave only ApplicationServices, to which I will be referencing from my model ? I would like to have only one connection string to the database, because I'm using only one database (replacing the constructor parameter from name=VNKEntities to name=ApplicationServices is not working).
Regards