Hello,
I'm trying to bind a Panel Bar with data from 3 tables with Foreign Key relationship.
Departments --> Categories ---> Products
---------------------------------------------------------
DepartmentId CategoryId ProductId
Name DepartmentId(fk) CategoryId(fk)
Name Name
I access these tables via methods:
I can bind to the panel bar like this and return a list of departments. But I'm having problems getting the categories to persist as PanelBarItems.
I've come aross this post referencing this example explaining manual creation of the panel bar items. The example shows how to do this using an OleDbDataAdapter.
How can I create this scenario using my methods ?
OR
Is there an alternative way of doing this ?
Thank you in advance,
Ronnie
I'm trying to bind a Panel Bar with data from 3 tables with Foreign Key relationship.
Departments --> Categories ---> Products
---------------------------------------------------------
DepartmentId CategoryId ProductId
Name DepartmentId(fk) CategoryId(fk)
Name Name
I access these tables via methods:
- LoadDepts();
- LoadCategories(int deptId);
- LoadProducts(int catId);
I can bind to the panel bar like this and return a list of departments. But I'm having problems getting the categories to persist as PanelBarItems.
Departments depts = new Departments(); |
depts.Load(); |
pnlbarDepartments.DataSource = depts; |
pnlbarDepartments.DataTextField = "DisplayText"; |
pnlbarDepartments.DataValueField = "ID"; |
pnlbarDepartments.DataBind(); |
I've come aross this post referencing this example explaining manual creation of the panel bar items. The example shows how to do this using an OleDbDataAdapter.
How can I create this scenario using my methods ?
OR
Is there an alternative way of doing this ?
Thank you in advance,
Ronnie