Eg.
ConnectionDetails cd = new ConnectionDetails ();
cd.ProviderName = "System.Data.OleDb";
cd.DataSource = "serverAddress";
cd.Catalog = "database";
cd.UserId = "userId";
cd.Password = "password";
string connectionString = cs.CreateConnectionString();
// Should return:
// "Provider=SQLOLEDB;Data Source=serverAddress;Initial Catalog=database;User Id=userId;Password=password;"
I'd write my own class but I'm not sure how to retrieve a connection string provider property (SQLOLEDB in this example) programmatically from an invariant db provider name (System.Data.OleDb).
Edit:
You can do a
DbProviderFactories.GetFactory("System.Data.OleDB").CreateConnectionStringBuilder()
But the DBConnectionStringBuilder that is returned still doesn't know it's connection string provider property, even though in this case it the derived class has a "Provider" property.