I've been using following LINQ for querying records from IEnumerable(Datarow). Instead of hardcoding field names in Linq, I want to pass string[] as input parameter and field names needs to be retrieved from string[]. Please assist me on this.
- List<string[]> IDcolls = drResults.Select(q => new[]
- {
- q["empid"].ToString(),
- q["empname"].ToString()
- })
- .Skip(mBatch * batchSize)
- .Take(batchSize)
- .ToList();
- string[] IDs = (from q in drResults
- select q["empid"].ToString())
- .Skip(i * batchSize)
- .Take(batchSize)
- .ToArray();