Need help printing sql data in treeview format in console

I am trying to print data from sql in c# console in tree view format, so that if I were to change data from table by increasing a number or changing a letter treeview should adapt to changes and indent the child folders.

My code so far: My sql table: What I want it to look like: Random example of treeview format:

submitted by /u/Csharped
[link] [comments]

Leave a Reply