Skip to content

Instantly share code, notes, and snippets.

Created June 9, 2010 19:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/432083 to your computer and use it in GitHub Desktop.
Save anonymous/432083 to your computer and use it in GitHub Desktop.
public class MyConnectionProvider : DriverConnectionProvider
{
private string server;
private string password;
private string userName;
protected override string ConnectionString
{
get
{
var original = base.ConnectionString;
var newConnectionString = original
.Replace("[Server]", server)
.Replace("[Username]", userName)
.Replace("[Password]", password);
return newConnectionString;
}
}
public void SetNewCredentials(string newUserName, string newPassword, string newServer)
{
userName = newUserName;
password = newPassword;
server = newServer;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment