treeview handle by database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jawaidmcs550
    New Member
    • Aug 2007
    • 1

    treeview handle by database

    i want to learn treeview handle by database
  • shweta123
    Recognized Expert Contributor
    • Nov 2006
    • 692

    #2
    Hi,

    What platform are you using and What do you want to do with the treeview?

    Originally posted by jawaidmcs550
    i want to learn treeview handle by database

    Comment

    • gmail
      New Member
      • Aug 2007
      • 8

      #3
      Originally posted by shweta123
      Hi,

      What platform are you using and What do you want to do with the treeview?

      Hi Friend,
      I am also trying to get somme info about tree view . can you please let me kinow about the reusability of tree view.

      TIOA,
      Gmail

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        Have you guys checked out MSDN's Library on the TreeView Class?

        It has a lot of examples in both VB.NET and C#.


        Cheers!
        -Frinny

        Comment

        • shweta123
          Recognized Expert Contributor
          • Nov 2006
          • 692

          #5
          Hi,

          You can have this code to add nodes using db.
          [code=vbnet]
          Dim con As New OleDbConnection
          Dim ds As New DataSet
          Dim da As OleDbDataAdapte r
          Dim dt As New DataTable
          Dim td As TreeNode
          Dim td1 As TreeNode

          Dim sql As String

          con.ConnectionS tring = "Provider=SQLOL EDB.1;......... ..."
          con.Open()

          sql = "Select .............."
          da = New OleDbDataAdapte r(sql, con)
          da.Fill(dt)

          For i As Integer = 0 To dt.Rows.Count - 1
          td = New TreeNode(dt.Row s(i).Item(0))
          ' To add Parent nodes
          TreeView1.Nodes .Add(td)

          ' To add the child nodes
          td1 = New TreeNode(dt.Row s(i).Item(0))
          td.Nodes.Add(td 1)
          Next
          con.Close()[/code]
          Last edited by Frinavale; Aug 3 '07, 03:17 PM. Reason: Added [code] tags to make more legible

          Comment

          Working...