How do I create connection string programmatically to MS SQL in Entity Framework 6?
I\'m using c# and WPF and I was wondering if someone could show me how or link me to
You could use the ProductivityTools.ConnectionString nuget package. It has 3 methods:
Last method will be right for you and asssuming that your edmx is named Product after invocation
ConnectionStringHelper.ConnectionString.GetSqlEntityFrameworkConnectionString
("serverName", "databaseName", "Product");
Package will return:
metadata=res://*/Product.csdl|res://*/Product.ssdl| res://*/Product.msl;
provider=System.Data.SqlClient;provider connection string="Data Source=serverName;
Initial Catalog=databaseName;Integrated Security=True"