I am trying to save my connection string to a configuration file but the password is not being submitted.
Here is the code I am using:
using (var con = new SqlConnection(string.Format("Data Source={0};Initial Catalog={3};User ID={1};Password={2};",
textBox_SqlServer.Text, textBox_Username.Text, textBox_Password.Text, comboBox_DatabaseName.Text)))
{
// test connection before continuing
con.Open();
configs.ApplicationConfiguration.SetConnectionString(con.ConnectionString);
}
All is fine until con.ConnectionString and it does not include the password. What do I need to do to So, naturally, when I go to retrieve it, the password is not there.
How do I get the password to set also?
Postback,