|why to make this process that much complex....?
you better do as following:-
try to get the command argument field with common name from both tables...
(using alias in select query).
select catid, catname, cast(catid as varchar(10)) + ':CAT' as commandID from tblcategory
select itemid, itemname, cast(itemid as varchar(10)) + ':ITEM' as commandID from tblitems
assign the function name & command argument at design time.
in the code-behind, check for commandargument,
split it and check for CAT or ITEM and then do the needfull.