}//Page_Load /// <summary>DropDownListTableName_PreRender</summary> public void DropDownListTableName_PreRender ( object sender, EventArgs e ) { if ( !Page.IsPostBack ) { if ( DropDownListTableName.Items.Count < 1 ) { DropDownListTableName.DataSourceID = null; DropDownListTableName.DataTextField = null; DropDownListTableName.DataValueField = null; DropDownListTableName.DataSource = TableNameURI; DropDownListTableName.DataBind(); }//if ( DropDownListTableName.Items.Count < 1 ) UtilityWebControl.SelectItem ( DropDownListTableName, TableNameURIDefault ); }//if ( !Page.IsPostBack ) }//public void DropDownListTableName_PreRender()
/// <summary>Page Load.</summary> public void Page_Load ( object sender, EventArgs e ) { String exceptionMessage = null; try { Server.ScriptTimeout = 60 * 60 * 12; //12 hours ServerMachineName = Server.MachineName; ServerMapPath = this.MapPath(""); /* FilenameConfigurationXml = Server.MapPath( FilenameConfigurationXml ); */ if ( ServerMapPath != null) { FilenameConfigurationXml = ServerMapPath + @"\" + FilenameConfigurationXml; }//if ( ServerMapPath != null) if ( !Page.IsPostBack ) { UtilitySQLServerManagementObjectsSMO.SQLServerList ( ref ServerName, ref exceptionMessage ); if ( exceptionMessage != null ) { Feedback = exceptionMessage; return; }//if ( exceptionMessage != null ) UtilitySQLServerManagementObjectsSMO.ConfigurationXml ( FilenameConfigurationXml, ref exceptionMessage, ref DatabaseConnectionString, ref DatabaseName, ref DefaultName, ref DirectoryBackup, ref DirectoryMaintenance, ref DirectoryScript, ref RuleName, ref ServerName, ref SqlServerLoginUserName, ref SqlServerPassword, ref StoredProcedureName, ref TableName, ref TriggerName, ref UserDefinedDataTypeName, ref UserDefinedFunctionName, ref ViewName ); if ( exceptionMessage != null ) { Feedback = exceptionMessage; return; }//if ( exceptionMessage != null ) ListBoxServer.DataSource = ServerName; ListBoxServer.DataBind(); if ( Array.BinarySearch ( ServerName, ServerMachineName, System.Collections.CaseInsensitiveComparer.DefaultInvariant ) >= 0 ) { UtilityWebControl.SelectItem ( ListBoxServer, ServerMachineName ); ServerSelected(); }//if ( Array.BinarySearch( ServerName, ServerMachineName, System.Collections.CaseInsensitiveComparer.DefaultInvariant ) >= 0 ) BackupDirectory = DirectoryBackup; MaintenanceDirectory = DirectoryMaintenance; ScriptDirectory = DirectoryScript; if ( !string.IsNullOrEmpty( SqlServerLoginUserName ) ) { SQLServerLoginUserName = SqlServerLoginUserName; } if ( !string.IsNullOrEmpty( SqlServerPassword ) ) { SQLServerPassword = SqlServerPassword; } }//if ( !Page.IsPostBack ) }//try catch ( System.Exception exception ) { exceptionMessage = "System.Exception: " + exception.Message; } if ( exceptionMessage != null ) { Feedback = exceptionMessage; return; }//if ( exceptionMessage != null ) }//Page_Load