I'm populating the FlyTreeView making a DataBind with my Database table:
Dim strStringaConnessione As String = myStrConnection
Dim objConn As New SqlConnection(strStringaConnessione)
Dim SQL_Legge As String = vbNullString
Dim myStrTableName As String = "myTreeView"
'
SQL_Legge &= "SELECT IDNodo, IDPadre, Descrizione FROM " & myStrTableName
'
Dim myDataSet As New DataSet
Dim objDataAdapter As New SqlDataAdapter(SQL_Legge, objConn)
objDataAdapter.Fill(myDataSet, myStrTableName)
Dim objDataView As New DataView(myDataSet.Tables(myStrTableName))
Dim hierarchicalData As IHierarchicalEnumerable = flyTreeView.ConvertTabularDataToHierarchical(myDataSet, myStrTableName, "IDNodo", "IDPadre")
flyTreeView.DataSource = hierarchicalData
flyTreeView.DataBind()
Now I would like to extend this code to SELECT THE NODE TO SHOW IN THE TREEVIEW, for example setting the nodes by its "IDNodo" and populate the FlyTreeView whith this node and all its childe node (and ONLY this one).
If I modify the Select Query, adding this filter it doesen't work:
Dim StartFolder as Integer = 261
SQL_Legge &= "SELECT IDNodo, IDPadre, Descrizione FROM " & myStrTableName & " "
SQL_Legge &= "WHERE IDNodo = " & StartFolder
Is there a way to solve the problem?
THANK YOU.
igor