This has been tested to work. The only difference is that it omits the "GetSection".
Remember that if you are testing this in a debug session and you are using the vs host, this change will be applied to the appName.vshost.exe.Config file.
public static void ModifyConnectionString(string connectionString)
{
Configuration config =
ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
ConnectionStringSettingsCollection connectionStrings =
config.ConnectionStrings.ConnectionStrings;
connectionStrings["INATTSQLConnString"].ConnectionString = connectionString;
config.Save();
ConfigurationManager.RefreshSection("connectionStrings");
}