Click here to Skip to main content
15,861,168 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Good day all!!!

I have a DataRowView array that I'm creating as below:

C#
DataRowView[] drv = e.GroupItems.Cast<DataRowView>().ToArray();


My question is how do I get a DataRow array (DataRow[]) for the 'drv' using drv.Select()???

Or do I have to actually have to do it using a foreach loop???
Posted

1 solution

This is what I have come up with. Any comments on if, or if there is a better way:


C#
DataRowView[] drv = e.GroupItems.Cast<datarowview>().ToArray();

DataRow[] rows = (from dr in drv select dr.Row).ToArray();
</datarowview>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900