Your ConnectionString
is initialized only once just because you made it so:
public static string ConnectionString
{
get
{
if (_ConnectionString == null)
_ConnectionString = FunctionToDynamicallyCreateConnectionstring();
return _ConnectionString;
}
}
After the property is called once, the recorded value is used and is never allowed to change.
You need a "reset method"
public void ResetConnectionParams()
{
_ConnectionString = null;
}
This way the very next time the property is called, it is allowed to rebuild parameters with new values. This means that your new connections will be created with the new, altered connection string. Make sure to call this new method somewhere!