public override void Initialize(string name, System.Collections.Specialized.NameValueCollection config) { string connectionString = config["connectionString"] = MVPTConnection.BuildMyCustomConnectionString(); base.Initialize(name, config);// Update the private connection string field in the base class. // Set private property of Membership provider. var connectionStringField = GetType().BaseType.GetField("_sqlConnectionString", BindingFlags.Instance | BindingFlags.NonPublic); connectionStringField.SetValue(this, connectionString); }
public override void Initialize(string name, NameValueCollection config) { string connectionString = config["connectionString"] = MVPTConnection.BuildMyCustomConnectionString(); base.Initialize(name, config); // Set private property of Membership provider. FieldInfo connectionStringField = GetType().BaseType.GetField("_sqlConnectionString", BindingFlags.Instance | BindingFlags.NonPublic); connectionStringField.SetValue(this, connectionString); }