Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

inseting a node and all its child

Status
Not open for further replies.

231166

Programmer
Apr 5, 2005
104
0
0
FR
Hi,




Each time i need to copy one term in a treeview( we suppose the treeview is composed with terms only) and all its childs, from one place to another , i need to insert in the table MICRO_THESAURUS ( because when i copy a term it makes part also of a new micro_thesaurus) this term with all its childs.

For example if i have this part of the tree, which is composed with the terms which tag is 15,14,8,4 and the terms which tag 14,8,4 are childs of the term which tag = 15

The micro_thesaurus number's of 'economy ' =3 and the micro_thesaurus number's of 'history' is =5 ( it corresponds to the field 'id_terme_source' of the table MICRO_THESAURUS)

[blue]
economy
15
14
8
4



[/blue]
and i want to copy this part of the tree in the microthesaurus = history
[blue]
history
15
14
8
4
[/blue]



How can i do this?


the sql request i can do until now is this one
[green]
INSERT into MICROTHESAURUS( id_terme_source,id_microthesaurus) values
(15,5)
[/green]
[red]
but we can not see all the childs of the term which tag =15 in this sql request!
[/red]
Could you help me on this point?

Last time Jebenson help me well for updating a node with this sql request
[blue]
sqlUpdateGeneriques = "update GENERIQUES set ID_TERME_GENERIQUES = ParentTag where ID_TERME_SOURCE_G IN ("
For Each ChildNode As TreeNode In TreeView1.SelectedNode.Nodes
sqlUpdateGeneriques &= ChildNode.Tag & ","
Next

'remove trailing comma
sqlUpdateGeneriques = Mid(sqlUpdateGeneriques, 1, Len(sqlUpdateGeneriques) - 1)

sqlUpdateGeneriques &= ")"


[/blue]

[green]Perhaps he could me this time on this point, but this question is absolutely opened to everyone[/green].

Thanks a lot from you.

Best regards.

Nathalie

 
You need to update your Treeview. This would have to be done on every PC in order to see the changes.

TreeView1.Nodes.Clear

Use your TreeView load code to reload it.

I hope this helps.

Ron Repp

If gray hair is a sign of wisdom, then I'm a genius.
 
Hi,

Thanks for your answer but it seems yiu did't understand well what i need.

I need to insert in one sqlrequest the term it self(here the term which tag=15) with all its childs in the database.

the example i gave is an sql uddate concerning a node and its childs.How can i do with an isert request?

Thanks for your help.

Nathalie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top