/    Sign up×
Community /Pin to ProfileBookmark

treeview creation

Hi,

Here is the situation :

I have created a table named TERME which contains terms choosen by a documentalist.

Here is the structure of the TERME table :

ID_TERME, Lib_TERME(the litteral of the term), EM(number of the synonymous which is also a term), Na( litteral), Date.

I have created a table GENERIQUES which contains the terms of the TERME table with their generic term(s) (generic means of a higher hierarchical level)

The structure of the table GENERIQUES is that one :

ID_TG, ID_TERME_SOURCE(which is the number of the term in the table TERME which has a generic term), ID_TERME_GENERIQUE which is the number of the generic term,which is himself a term of the TERME table.

In that table GENERIQUES there are terms which don’t have generic terms because they are roots and so the value of the field ID_TERME_GENERIQUE =0 for them
I would like to create a Treeview which shows
-all the roots
-all the terms which have roots to a higher level( the roots are generic terms)

for the moment i only have succeed to create a treeview who shows all the terms of the TERME table.
Even if the sql request is correct, i don’t see on the interface what is selected in the sql request. ?
I think there is a problem with the datatable.

thanks a lot again for your help and the time consacreted to help me.
Cordially.
Nathalie Harbonne

Here is the code implemented :

[code]

Imports System.Data
Imports System.Data.SqlClient
Imports Microsoft.Web.UI.WebControls

Public Class TreeView1
Inherits System.Web.UI.Page
Protected WithEvents TreeView1 As Microsoft.Web.UI.WebControls.TreeView

Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim sConnString As String = “Data Source = localhost ; Initial Catalog =THESAURUS ; User Id =””; Password=””; integrated security = SSPI”
Dim objConn As New SqlConnection(sConnString)
Dim objDS As New DataSet()
Dim da1 As New SqlDataAdapter(“SELECT Lib_TERME from TERME where ID_TERME IN (SELECT ID_TERME_SOURCE_G from GENERIQUES WHERE ID_TERME_GENERIQUE = 0)
da1.Fill(objDS, “dtTERME”)
objConn.Close()
‘création des types de données du tree view
Dim nodeTERME As TreeNode
Dim rowTERME As DataRow

For Each rowTERME In objDS.Tables(“dtTERME”).Rows
nodeTERME = New TreeNode()
nodeTERME.Text = rowTERME(“Lib_TERME”)
TreeView1.Nodes.Add(nodeTERME)
Next

End Sub

End Class

[/code]

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@BigMoosieMay 13.2005 — This is a JavaScript forum and that aint JavaScript ?
×

Success!

Help @harbonne spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...