Basically, the idea is to match data from one DataTable with another. In the first DT, there are 20 different columns in one row that I create an array from, and there is another DT with thousands of rows, two columns each. I need to select all of those rows in the second DT that are found among all of the 20 different variables in the array (so, I go row by row in the first table).
Can I do this in one query?
for (int x = 0; x < 20; x++) //this fills up the array from the 20 columns of dt1
{
numbers[x] = Convert.ToInt16(dt1.Rows[i]["n" + (x+1)]);
}
var filtered = dt2.Select("Col1 = " + (any of the numbers[]) + " AND Col2 = " + (any of the numbers[]));
So clearly the line in question is the last one. I'm not sure if it's possible to do so.
I'm new here and I'm new to C# as well. Thank you for your help.