Linq replacement for select query

DT.Select(" Convert(["+str_CurrentVC+"],‘System.String’) like ‘%"+ str_CurrentSCValue+"%’")
can you suggest me a linq query instead of the above select query please

Hi @Amrutha.mg

Try this

DT.AsEnumerable.Where(Function (x) x(str_CurrentVC).ToString.Contains(str_CurrentSCValue)).ToArray

Query version

(From r in DT
Where r(str_CurrentVC).ToString.Contains(str_CurrentSCValue)
Select r).ToArray
1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.