Hi,
Write a simple linq query to get the values.
As I assumed your DataTable is:
1 Amit
2 Test1
3 Test2
4 Test3
5 test4
And your ID is:
int[] id = new int []{ 1, 3, 5 };
So your query should be something like this:
var query = (from s in dt.AsEnumerable()
join p in id.AsEnumerable() on s.Field<int>("ID")
equals Convert.ToInt32(p)
select s);
DataTable FilteredData = query.Count() > 0 ? query.CopyToDataTable() : null;</int>
So, this query will give you the resultant datatable and the output will be like this:
1 Amit
3 Test2
5 test4
Hope it helped you.
---Amit