Mostly if not ALL of your problem is in
GetCategories()
Why are you running a query in your DAL and then trying to do the same in your GetCategories method?
I would firstly check to make sure that the
ds
variable has data inside of it when you run that routine (just in case you ask how? put a breakpoint on that line, step over it and through the debugger see what gets returned).
If that returns records, you can then do something like this
foreach(var row in ds)
{
int CategoryID = row.CategoryID;
}
hopefully this should give you something to get started with.