I'm not sure if this is the best way to accomplish my end goal, but here is where I am at:
I have 3 functions
function1: returns top level product categories in a dataset
function2: returns sub categories of the selected category in a dataset
function3: returns items for the selected sub category in a dataset
I'm trying to populate some drop downs as a track back from the category/sub/item drill down.
Now I have function 4, which depending on where you are in the drilldown, is to return the categories and subcategories above the selection. Since I already have the functions built to return these, I don't really see a need to write a new function that does what these already do. Unfortunately, I'm hitting a roadblock in trying to add to a dataset using a function.
Works fine.
But now I move to the next step:
I'm at a loss of how to populate the subCats table using the already existing function. Any ideas?
Thanks in advance
I have 3 functions
function1: returns top level product categories in a dataset
function2: returns sub categories of the selected category in a dataset
function3: returns items for the selected sub category in a dataset
I'm trying to populate some drop downs as a track back from the category/sub/item drill down.
Now I have function 4, which depending on where you are in the drilldown, is to return the categories and subcategories above the selection. Since I already have the functions built to return these, I don't really see a need to write a new function that does what these already do. Unfortunately, I'm hitting a roadblock in trying to add to a dataset using a function.
Code:
DataSet dsTrackBack = new DataSet();
dsTrackBack = getProductCategories();
return dsTrackBack;
Works fine.
But now I move to the next step:
Code:
DataSet dsTrackBack = new DataSet();
dsTrackBack = getProductCategories();
if (subCat_id != "null")
{
DataSet subCats = new DataSet();
dsTrackBack.Tables.Add("subCats");
populate table somehow
}
return dsTrackBack;
I'm at a loss of how to populate the subCats table using the already existing function. Any ideas?
Thanks in advance