Deleting data rows from data table

Hi,

I am getting "DataRow is not in the current DataRowCollection error" while using invoke method to delete data row from data table.

Error
Plz advise

Thanks
Jewel

@jewel,

Change TargetObject from dt_Master.Rows to data_to_del.Rows

Hi Lakshman,

dt_Master is the data table and data_to_del.Rows is my filtered data row array.There is no .rows option for data row array

HI @jewel

Check out the attached example to remove datarows from a datatable. I guess this is what you need to do…

DeleteDataRow.xaml (7.5 KB)

Let know if this helps!!!

@ Fernando Thanks it worked

@Lahiru.Fernando how to use not equal to in datatable select query?

@jewel,

Try below one:

dataTableName.select("[Column1] <> ‘Value’ AND [Column2] <> ‘Value’")

HI @jewel

Sorry for my late reply… Try the command @lakshman mentioned… It should work fine for you

You can also try
Not DataTableName.Select("ColumnName").ToString.Equals("Value")

image

1 Like

Hi,

How can I remove the row with year of JobTerminationDate + 3 < Current year?
image

Regards,
Tan.