I have the row collection and the Column names as list , is there way to pass all the column names using the delegate to a single row and return the values as a collection?.
or is there any other best way to accompolish this?.
I have the row collection and the Column names as list , is there
Share
Are you saying you have a
DataRowand you want the value in each column?Then all you need is this:
If you only want the values from specific columns, I’d recommend some LINQ magic to give them to you in the form of a
Dictionary<string, object>:Of course, you could also use this same LINQ magic to get a
Dictionary<string, object>for all columns (ifobject[]isn’t descriptive enough for your liking):