Click here to Skip to main content
15,891,673 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
Hi All,

I have a SQL table (called tblClosure) which has these fields:
1.LocationID
2.LocationDesc
3.ParentID

My question is how can I populate a treeview control from this datatable in winforms/vb? I have seen examples in c# but I'm a rookie coder and am having difficulties adapting that code.

Any help would be greatly appreciated.

Ideally all I need is a VB sub to build the TReeview Hierarchy from the table. I have seen this is C# but am struggling to convert to VB.

Thanks in advance
Posted
Updated 8-Aug-13 3:49am
v2

1 solution

If you understand VB.NET and not C#, this is pretty bad in practice. If you want help or look for some available code samples, the most of best solutions are in C#, not VB.NET, which are often is not taken seriously. Just the fact of real life. So, you really need to understand at least some of C#.

As to translation, it can be done easily enough. In my past answers, I suggested some on-line solutions and one really good and comprehensive off-line solution (open source ILSpy: it provides excellent translation results in no time, in the form of a ready-to-use project with all source code files):
COde Line Interpretatio of C# to VB.NET[^],
Need to convert vb code to c#[^],
FixedPage to ContentPage convert c# code into vb.net[^],
Source Code from a exe[^].

—SA
 
Share this answer
 
v2

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