Select method is not wording for filtering data Table, Please let me Know any another way or solution

uiautomation

#1

Hi , I have Excel data with Columns Name Like “EmpId, Name, Age, Department, Salary, Location”. reference use clicks below Image.

I want to get Data, whose Department is HR. But When I’m using the Select method, Getting error. Please resolve this


#2

Hi @chinnapureddy03

Check if this works for you

Filtred_DT=Your_DT.AsEnumerable().Where(Function(row) row(“Coulmn Name of DT”).ToString=“txt toFilter”).CopyToDataTable()

Below is a related post


#3

This is not working for me. Do we have to import something here ?


#4

@Chand wt error u r getting


#5

Hi @Chand,

Try this syntax:
dt_Emp.Select("[Department]=’"+Filter+"’")

or simpler:

dt_Emp.Select("[Department]=‘HR’")


#6

it worked. thanks


#7

Hello @loginerror
this is not working for me Let see my images


Image3 .

Based upon filter value , I want get result as shown in image 3.

@hkjobs1988,

Please can you explain your code


#8

Provide 07 within single Quote as ‘07’ and try :slightly_smiling_face:


#9

same issue, Can’t find the column


#10

Hello,

I tried one more method , That is also not working to me . Let see below images you will get idea. Please let me know any have alternate method or excel macro codes.



Image5


#11

Please check if there is any space in column header “Division”.


#12

Hello Guys,

Please someone help me as the filter fuction is not working properly foe me as well.