I know how to write for one value.
(
From row In ExtractDataTable
Where CStr(row(“Name”)) =“New Delhi”
Select row
).CopyToDataTable
How to select multi cities?
I know how to write for one value.
(
From row In ExtractDataTable
Where CStr(row(“Name”)) =“New Delhi”
Select row
).CopyToDataTable
How to select multi cities?
Try this
(
From row In ExtractDataTable
Where CStr(row(“Name”)) =“New Delhi” andalso CStr(row(“Name”)) =“TN”
Select row
).CopyToDataTable
or
(
From row In ExtractDataTable
Where CStr(row(“Name”)) =“New Delhi” and CStr(row(“Name”)) =“TN”
Select row
).CopyToDataTable
you need to add and or andalso give your next condition and so on
Hope this Helps!
Regards
Sudharsan
Maybe the below Expression is what you require :
(
From row In ExtractDataTable
Where listOfCities.Contains(CStr(row("Name")))
Select row
).CopyToDataTable
Here, listOfCities
is an Array/List of String type variable, which contains different city names like below :
listOfCities = {"New Delhi","Punjab","Mumbai"}
Let us know if you requirement is different.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.