System.Data.DataRow.Delete C# (CSharp) Method

Delete() public method

Deletes the row.
public Delete ( ) : void
return void
        public void Delete()
        {
            if (_inDeletingEvent)
            {
                throw ExceptionBuilder.DeleteInRowDeleting();
            }

            if (_newRecord == -1)
            {
                return;
            }

            _table.DeleteRow(this);
        }

Usage Example

Example #1
0
        public void OnDeleteCommandExecute(object obj)

        {
            string role_id = "";

            try
            {
                System.Data.DataRow dataRow = ((System.Data.DataRowView)_colView.CurrentItem).Row;

                role_id = dataRow["role_id"].ToString();

                dataRow.Delete();
            }
            catch
            {
            }


            try
            {
                DataTable dt = roleEventData.employee_role_event; //posParamData.pos_param;
                foreach (DataRow dr in dt.Rows)
                {
                    if (string.Equals(dr["role_id"].ToString(), role_id))
                    {
                        dr.Delete();
                    }
                }
            }
            catch
            {
            }
        }
All Usage Examples Of System.Data.DataRow::Delete