How to pass variable as column name in select data table


#1

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


#2

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

Cheers. Happy Automation :slight_smile:


#3

Hi @pankajy,

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

Regards,
Arivu