Skip to content

Instantly share code, notes, and snippets.

@vgrem
Created May 18, 2013 20:04
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 vgrem/5605615 to your computer and use it in GitHub Desktop.
Save vgrem/5605615 to your computer and use it in GitHub Desktop.
public partial class DatabaseSettingsPage : GlobalAdminPageBase
{
protected override void OnLoad(EventArgs e)
{
//var isAdmin = SPFarm.Local.CurrentUserIsAdministrator();
base.OnLoad(e);
}
protected override void OnInit(EventArgs e)
{
btnSave.Click += new EventHandler(btnSave_Click);
base.OnInit(e);
}
void btnSave_Click(object sender, EventArgs e)
{
CreateConnectionString();
}
private void CreateConnectionString()
{
var connectionStrings = new SecuredConnectionString("ConnectionStrings");
connectionStrings.SetConnectionString("CRMConnString", txtConnectionString.Text);
connectionStrings.Update();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment