Converting result of data table into tree using C#
I have a dataset which contains 4 columns. Name, key, parentKey, Level. I
need to convert this DataTable into a tree structure. I am attaching an
image which will give you some idea what I want to do. What is the most
efficient way to convert the DataTable into an object which I can use to
generate a tree structure. Please help.
Please Note: Data can come in any order in DataTable. Is it possible to
sort the dataTable on first Level column and then on parentKey column? I
think, If I can do that, it would be easy to convert the output into tree
structure.
No comments:
Post a Comment