Hi,

I am working on a asp.net c# project where I need to get data from sql server database and dynamically populate treeview control consisting of 6 sub nodes.can any one tell me an easy way to do this.

thanks in advance
shiri

Use System.Data.SqlClient and System.Data namespace classes to connect database, execute command, and retrieve a result.

After that Create an instance of treeview node - say it is a root node.
Create six more treeview node instances, assigned text property of each node from a database result and add all these six nodes into root node.

After that add the root node to your Treeview control.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.