How to pass variable as column name in select data table

I want to pass variables in place of column name(Column1 and Column2).

Hi @pankajy, you could do String.Format(“[{0}] = {1} and [{2}] = {3}”,“Col1Name”,“Value1”,“Col2Name”,“Value2”)

Cheers. Happy Automation :slight_smile:

Hi @pankajy,

Try below code
mainDt.Select("Column1=row(0).ToString() and Column2= 'Reg'").length

Regards,
Arivu

1 Like