Avatar of ElrondCT
Flag for United States of America

asked on 

Sort array of strongly typed DataRows

I'm sure I'm missing something obvious, but I can't figure out how to sort an array of DataRows that have been drawn from a DataTable. I'm getting the child rows for a particular parent record using

dim drChildA() as dsSet.ChildARow = drParent.GetChildARows

I want to sort these rows, because I can't be certain they were entered in the proper order. (The primary key is a simple counter that's autoincremented for every new record, so it's not useful for this purpose.)

It seems to me there ought to be a way to choose a particular field (or fields) of the DataRow to use to sort, but I can't figure out how to put that into the structure of the Array.Sort method short of defining my own IComparer; I can do that, but it seems like it ought to be reinventing the wheel.
Visual Basic.NET

Avatar of undefined
Last Comment

8/22/2022 - Mon