I am writing an application on WPF (MVVM) using the Entity Framework (DataBase first). I want users to set the server name through interface, tell me how to do it please. If I pass the variable from the settings, I get a: System.ArgumentException keyword not supported 'data source'
.
using (var db = new PronetsDataBaseEntities(Properties.Settings.Default.ConnectionString)) { ...}
The ConnectionString is the same as it generated EntityFramework
(metadata=res://*/Data.PronetsDB.csdl|res://*/Data.PronetsDB.ssdl|res://*/Data.PronetsDB.msl;provider=System.Data.SqlClient;provider connection string="data source=DESKTOP-D6JRGFG\SQLEXPRESS;initial catalog=PronetsDB;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework")
Constructor on Entity:
public PronetsDataBaseEntities(string connectionString)
: base(connectionString)
{
}