vb.net form and treeview

  • Thread starter Thread starter dave
  • Start date Start date
D

dave

What is the most effecient method to take data from a
database table (sqlserver) to a vb.net treeview control.

The database table looks like
ID, Name, ParenetID
1 , test, <null>
2, test2, 1
3, test3, 2

The above would create a tree with 3 levels?

Suggestions?
thx
(code samples would be great)
 
Hello,

Thanks for your post. I suggest that yuu can retrieve the data from SQL
Server to a DataSet and then fill the TreeView. Please refer to the
following samples:

ADO.NET: Populate a DataSet from a Database
http://samples.gotdotnet.com/quickstart/howto/doc/adoplus/GetDataFromDB.aspx

Populate a TreeView from a SELF-JOINED table
http://www.codeproject.com/cs/database/2dtreeview.asp

Please feel free to let me know if you have any problems or concerns.

Have a nice day!

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Back
Top