Provides data for the RowUpdating event. This class cannot be inherited.
Inheritance: System.Data.Common.RowUpdatingEventArgs
Example #1
0
        private void OnRowUpdating(object sender, MySqlRowUpdatingEventArgs args)
        {
            // make sure we are still to proceed
            if (args.Status != UpdateStatus.Continue)
            {
                return;
            }

            if (_schema == null)
            {
                GenerateSchema();
            }

            if (StatementType.Delete == args.StatementType)
            {
                args.Command = CreateDeleteCommand();
            }
            else if (StatementType.Update == args.StatementType)
            {
                args.Command = CreateUpdateCommand();
            }
            else if (StatementType.Insert == args.StatementType)
            {
                args.Command = CreateInsertCommand();
            }
            else if (StatementType.Select == args.StatementType)
            {
                return;
            }

            SetParameterValues(args.Command, args.Row);
        }
Example #2
0
        private void RowUpdating(object sender, MySqlRowUpdatingEventArgs args)
        {
            RowUpdatingHandler(args);

            if (args.StatementType != StatementType.Insert)
            {
                return;
            }

            if (ReturnGeneratedIdentifiers)
            {
                if (args.Command.UpdatedRowSource != UpdateRowSource.None)
                {
                    throw new InvalidOperationException(
                              Resources.MixingUpdatedRowSource);
                }
                args.Command.UpdatedRowSource = UpdateRowSource.FirstReturnedRecord;
                if (finalSelect == null)
                {
                    CreateFinalSelect();
                }
            }

            args.Command.CommandText += finalSelect;
        }
 private void OnRowUpdating(object sender, MySqlRowUpdatingEventArgs e)
 {
     if ((int)e.Status != 0)
     {
         return;
     }
     if (this._schema == null)
     {
         this.GenerateSchema();
     }
     if ((StatementType)3 == e.StatementType)
     {
         e.Command = this.CreateDeleteCommand();
     }
     else if ((StatementType)2 == e.StatementType)
     {
         e.Command = this.CreateUpdateCommand();
     }
     else if ((StatementType)1 == e.StatementType)
     {
         e.Command = this.CreateInsertCommand();
     }
     else if ((int)e.StatementType == 0)
     {
         return;
     }
     MySqlCommandBuilder.SetParameterValues(e.Command, e.Row);
 }
Example #4
0
        protected override void OnRowUpdating(RowUpdatingEventArgs value)
        {
            MySqlRowUpdatingEventArgs    mySqlRowUpdatingEventArgs    = value as MySqlRowUpdatingEventArgs;
            MySqlRowUpdatingEventHandler mySqlRowUpdatingEventHandler = (MySqlRowUpdatingEventHandler)base.Events[MySqlDataAdapter.EventRowUpdating];

            if (mySqlRowUpdatingEventHandler != null && mySqlRowUpdatingEventArgs != null)
            {
                mySqlRowUpdatingEventHandler(this, mySqlRowUpdatingEventArgs);
            }
        }
Example #5
0
        /// <summary>
        /// Overridden. Raises the RowUpdating event.
        /// </summary>
        /// <param name="value">A MySqlRowUpdatingEventArgs that contains the event data.</param>
        override protected void OnRowUpdating(RowUpdatingEventArgs value)
        {
            MySqlRowUpdatingEventArgs margs = (value as MySqlRowUpdatingEventArgs);
            //			if (args.StatementType == StatementType.Insert)
//				FixupStatementDefaults(args);

            MySqlRowUpdatingEventHandler handler = (MySqlRowUpdatingEventHandler)Events[EventRowUpdating];

            if ((null != handler) && (margs != null))
            {
                handler(this, margs);
            }
        }
 private void RowUpdating(object sender, MySqlRowUpdatingEventArgs args)
 {
     base.RowUpdatingHandler(args);
 }
 private void RowUpdating(object sender, MySqlRowUpdatingEventArgs args)
 {
   base.RowUpdatingHandler(args);
 }
Example #8
0
        private void RowUpdating(object sender, MySqlRowUpdatingEventArgs args)
        {
            base.RowUpdatingHandler(args);

            if (args.StatementType != StatementType.Insert) return;

            if (ReturnGeneratedIdentifiers)
            {
                if (args.Command.UpdatedRowSource != UpdateRowSource.None)
                    throw new InvalidOperationException(
                        Resources.MixingUpdatedRowSource);
                args.Command.UpdatedRowSource = UpdateRowSource.FirstReturnedRecord;
                if (finalSelect == null)
                    CreateFinalSelect();
            }

            if (finalSelect != null && finalSelect.Length > 0)
                args.Command.CommandText += finalSelect;
        }
Example #9
0
 void DataAdapter_RowUpdating( object sender, MySqlRowUpdatingEventArgs e )
 {
 }
Example #10
0
File: MySQL.cs Project: oeli/yafra
 /// <summary>
 /// Handles the RowUpdating event
 /// </summary>
 /// <param name="obj">The object that published the event</param>
 /// <param name="e">The OleDbRowUpdatingEventArgs</param>
 protected void RowUpdating(object obj, MySqlRowUpdatingEventArgs e)
 {
     base.RowUpdating(obj, e);
 }