I have a wpf application backed up by Entity Framework code first. The application allows user to create new databases and work on them using wpf screens. The creation of a new database is pretty straight forward in Entity Framework code first and is not an issue. However, I am struggling to find a decent way of associating a particular wpf client with current Database he is working on. The database connection string is constructed as given below.
providerConnectionString = "Server=" + serverName + ";" + "Database=" + databaseName +
"; User Id = userId; Password = password; Persist Security Info=True;";
As you can see above I have to store Server, Database Name, UserId and Password somewhere on client machine so that proper database can be picked up for use when the client starts up the wpf application. To add some more complexity, the user can switch from one database to another if he wishes to using the wpf application. In that case I will have to reset the four connection string parameters stated above to point to new database.
I don't wan't any password protection for the WPF application. Everything written above applies only to SQL Server database connection string.
So in summary, what would be the best way to store the sql server connection string information for a particular wpf client, in an scenario where new databases can be added dynamically from wpf application.