Tuesday, 20 August 2013

asp.net getting folder hierarchy from database?

asp.net getting folder hierarchy from database?

I've been given a rather large sql database with many sub folders that
eventually all lead to different data tables. I'm doing my binding in the
behind code with sqldataAdapter and coding in VS. I was wondering if there
was a way that I could retrieve a folder and all its children from the
database as one object/set so I could bind it to a radMenu. If not how
would I go about retrieving a folder and its sub hierarchy? I'm pretty new
to sql and only know the basic SELECT *, UPDATE, DELETE commands.
Just for an example here's a simple hierarchy:
DB->directory-> sub-dir-> table
CountryDB->China
England
Russia
America -> Arizona
Montana
Nevada
California -> LATble, SanFranTbl, MontereyTbl
How could I retrieve the CountryDB and its hierarchy and bind it to a menu?
If it helps, here's some of the options I could use for data sources to
bind with:
For inherently hierarchical data sources, RadMenu will automatically
creates the menu item hierarchy. Such data sources include
XmlDataSource
SiteMapDataSource
For table-structured data sources, RadMenu uses the ID to ParentID
relationship to establish a hierarchy. Such data sources include
DataSet, DataTable, and DataView
SqlDataSource
AccessDataSource
For object-based data sources, RadMenu uses the ID to ParentID
relationship to establish a hierarchy. Such data sources include
ObjectDataSource
LinqDataSource
Any class that implements the IEnumerable interface such as List,
Array, ArrayList, etc.

No comments:

Post a Comment