Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Reading data in datatable recursively

$
0
0
hae guys....
how do i read and refresh my datatable each time i execute an sql statement....
i want to create a treeview structure with data in my database ...the node is a recruiter id (rid) and the child node is a member shares the same rid...Here is my code but wen i run it i get this error "An unhandled exception of type 'System.StackOverflowException' occurred in MySql.Data.dll"
 Public Sub filltree(ByVal key As String, ByVal txt As String, ByVal N As TreeNode)
        
        Dim nn As TreeNode
        If N Is Nothing Then
            nn = TreeView1.Nodes.Add(key, txt)
        Else
            nn = N.Nodes.Add(key, txt)

        End If

        Dim da As New MySqlDataAdapter(" select rid,firstname from members where rid  ='" & key & "' ", conn)
        da.Fill(dt)
        For Each Me.dr In dt.Rows
            '' MsgBox(dr.Item("firstname"))
            filltree(dr.Item("rid"), dr.Item("firstname"), nn)
        Next dr



    End Sub


Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>