Category - Subcategory in Asp.net Vb.net Datalist

tidustr
tidustr used Ask the Experts™
on
I have database in MS SQL Server

Hi, i have two tables as;

First table name: Categories
Columns: cat_id, cat_name

Second Table Name: Subcategories
Columns: subcat_id, subcat_name, cat_id

cat_id in both tables has relationship.
In asp.net page i want to get these rows in datalist like

Category

 - Sub Category
 - Sub Category
 - Sub Category

Category

 - Sub Category
 - Sub Category
 - Sub Category

How do i do that in VB.NET please explain it ?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Hi, tidustr.
This is not a difficult thing to do, here's an article that explain stuff
http://www.netomatix.com/GridInGrid.aspx

####################
another way of doing it:
someone already create a custom webcontrol to handle this:

Web control that would allow displaying nested tables, parent-child tables in a datagrid. Please click the following url:
http://www.denisbauer.com/ASPNETControls/HierarGrid.aspx

for demo please click the following url:
http://www.denisbauer.com/ASPNETControls/NestedHierarGridDemo.aspx

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial