Exemplo n.º 1
0
        // Set Database Recovery Mode
        /// <summary>
        /// The btn recovery mode_ click.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="e">
        /// The e.
        /// </param>
        protected void btnRecoveryMode_Click(object sender, EventArgs e)
        {
            using (var DBName = new YafDBConnManager())
            {
                try
                {
                    string dbRecoveryMode = string.Empty;
                    if (this.RadioButtonList1.SelectedIndex == 0)
                    {
                        dbRecoveryMode = "FULL";
                    }

                    if (this.RadioButtonList1.SelectedIndex == 1)
                    {
                        dbRecoveryMode = "SIMPLE";
                    }

                    if (this.RadioButtonList1.SelectedIndex == 2)
                    {
                        dbRecoveryMode = "BULK_LOGGED";
                    }

                    DBName.InfoMessage          += connMan_InfoMessage;
                    this.txtIndexStatistics.Text = DB.db_recovery_mode_warning(DBName);
                    DB.db_recovery_mode(DBName, dbRecoveryMode);
                    this.txtIndexStatistics.Text = "Database recovery mode was successfuly set to " + dbRecoveryMode;
                }
                catch (Exception error)
                {
                    this.txtIndexStatistics.Text = "Something went wrong with this operation.The reported error is: " + error.Message;
                }
            }
        }
Exemplo n.º 2
0
 protected void btnReindex_Click(object sender, EventArgs e)
 {
     using (YafDBConnManager connMan = new YafDBConnManager())
     {
         connMan.InfoMessage    += new YafDBConnManager.YafDBConnInfoMessageEventHandler(connMan_InfoMessage);
         txtIndexStatistics.Text = DB.db_reindex_warning(connMan);
         DB.db_reindex(connMan);
     }
 }
Exemplo n.º 3
0
		protected void btnReindex_Click( object sender, EventArgs e )
		{            
			using ( YafDBConnManager connMan = new YafDBConnManager() )
			{
				connMan.InfoMessage += new YafDBConnManager.YafDBConnInfoMessageEventHandler( connMan_InfoMessage );
                txtIndexStatistics.Text = DB.db_reindex_warning(connMan);
                DB.db_reindex( connMan );
			}
		}
Exemplo n.º 4
0
 // Reindexing Database
 /// <summary>
 /// The btn reindex_ click.
 /// </summary>
 /// <param name="sender">
 /// The sender.
 /// </param>
 /// <param name="e">
 /// The e.
 /// </param>
 protected void btnReindex_Click(object sender, EventArgs e)
 {
     using (var connMan = new YafDBConnManager())
     {
         connMan.InfoMessage         += connMan_InfoMessage;
         this.txtIndexStatistics.Text = DB.db_reindex_warning(connMan);
         DB.db_reindex(connMan);
     }
 }
Exemplo n.º 5
0
 protected void btnGetStats_Click(object sender, EventArgs e)
 {
     using (YafDBConnManager connMan = new YafDBConnManager())
     {
         connMan.InfoMessage += new YafDBConnManager.YafDBConnInfoMessageEventHandler(connMan_InfoMessage);
         // connMan.DBConnection.FireInfoMessageEventOnUserErrors = true;
         txtIndexStatistics.Text = DB.db_getstats_warning(connMan);
         DB.db_getstats(connMan);
     }
 }
Exemplo n.º 6
0
		protected void btnGetStats_Click( object sender, EventArgs e )
		{

			using ( YafDBConnManager connMan = new YafDBConnManager() )
			{
				connMan.InfoMessage += new YafDBConnManager.YafDBConnInfoMessageEventHandler( connMan_InfoMessage );
				// connMan.DBConnection.FireInfoMessageEventOnUserErrors = true;
                txtIndexStatistics.Text = DB.db_getstats_warning(connMan);
                DB.db_getstats( connMan );
			}
		}
Exemplo n.º 7
0
        protected void btnRunQuery_Click(object sender, EventArgs e)
        {
            txtResult.Text       = "";
            ResultHolder.Visible = true;

            using (YafDBConnManager connMan = new YafDBConnManager())
            {
                connMan.InfoMessage += new YafDBConnManager.YafDBConnInfoMessageEventHandler(connMan_InfoMessage);
                string sql = txtQuery.Text.Trim();
                // connMan.DBConnection.FireInfoMessageEventOnUserErrors = true;
                sql            = sql.Replace("{databaseOwner}", DBAccess.DatabaseOwner);
                sql            = sql.Replace("{objectQualifier}", DBAccess.ObjectQualifier);
                txtResult.Text = DB.db_runsql(sql, connMan);
            }
        }
Exemplo n.º 8
0
		protected void btnRunQuery_Click( object sender, EventArgs e )
		{
			txtResult.Text = "";
			ResultHolder.Visible = true;

			using ( YafDBConnManager connMan = new YafDBConnManager() )
			{
				connMan.InfoMessage += new YafDBConnManager.YafDBConnInfoMessageEventHandler( connMan_InfoMessage );
				string sql = txtQuery.Text.Trim();
				// connMan.DBConnection.FireInfoMessageEventOnUserErrors = true;
				sql = sql.Replace( "{databaseOwner}", DBAccess.DatabaseOwner );
				sql = sql.Replace( "{objectQualifier}", DBAccess.ObjectQualifier );
				txtResult.Text = DB.db_runsql( sql, connMan );
			}
		}
Exemplo n.º 9
0
    /// <summary>
    /// The btn run query_ click.
    /// </summary>
    /// <param name="sender">
    /// The sender.
    /// </param>
    /// <param name="e">
    /// The e.
    /// </param>
    protected void btnRunQuery_Click(object sender, EventArgs e)
    {
      this.txtResult.Text = string.Empty;
      this.ResultHolder.Visible = true;

      using (var connMan = new YafDBConnManager())
      {
        connMan.InfoMessage += this.connMan_InfoMessage;
        string sql = this.txtQuery.Text.Trim();
        
        // connMan.DBConnection.FireInfoMessageEventOnUserErrors = true;
        sql = sql.Replace("{databaseOwner}", Config.DatabaseOwner);
        sql = sql.Replace("{objectQualifier}", Config.DatabaseObjectQualifier);

        this.txtResult.Text = DB.db_runsql(sql, connMan, this.chkRunInTransaction.Checked);
      }
    }
Exemplo n.º 10
0
 // Mod By Touradg (herman_herman) 2009/10/19
 // Shrinking Database
 /// <summary>
 /// The btn shrink_ click.
 /// </summary>
 /// <param name="sender">
 /// The sender.
 /// </param>
 /// <param name="e">
 /// The e.
 /// </param>
 protected void btnShrink_Click(object sender, EventArgs e)
 {
     using (var DBName = new YafDBConnManager())
     {
         try
         {
             DBName.InfoMessage          += connMan_InfoMessage;
             this.txtIndexStatistics.Text = DB.db_shrink_warning(DBName);
             DB.db_shrink(DBName);
             this.txtIndexStatistics.Text = "Shrink operation was Successful.Your database size is now: " + DB.DBSize + "MB";
         }
         catch (Exception error)
         {
             this.txtIndexStatistics.Text = "Something went wrong with operation.The reported error is: " + error.Message;
         }
     }
 }
Exemplo n.º 11
0
		void connMan_InfoMessage( object sender, YafDBConnManager.YafDBConnInfoMessageEventArgs e )
		{
			txtIndexStatistics.Text = e.Message;
		}
Exemplo n.º 12
0
		void connMan_InfoMessage( object sender, YafDBConnManager.YafDBConnInfoMessageEventArgs e )
		{
			txtResult.Text = "\r\n" + e.Message;
		}