Try this
Private Sub fillTV()
Dim myCMD As OleDbCommand = New OleDbCommand("SELECT * FROM PRQ", cn)
Dim myRDR As OleDbDataReader = myCMD.ExecuteReader
tvMain.Nodes.Clear()
Do While myRDR.Read
Dim nd As New TreeNode()
nd.Text = myRDR.GetString(2)
nd.Tag = myRDR.GetString(1)
tvMain.Nodes.Add(nd)
Loop
myRDR.Close()
myCMD.Dispose()
End Sub
Main Topics
Browse All Topics





by: andrewpkPosted on 2004-07-05 at 22:58:32ID: 11478045
here's a sample thats included on the MSDN website library/en -us/vbcon9 8/html/ vbc onscenario viewingbib liomdbdata baseastree .asp
library/de fault.asp? url=/libra ry/ en-us/v bcon98/htm l/vbconusi ngtreeview control.as p
it connects to a database and draws up a treeview of whats inside
http://msdn.microsoft.com/
More info, refer to this:
http://msdn.microsoft.com/
andrew