Use
...
selectcommand="SELECT uname, uimg
FROM games
INNER JOIN categories_games
ON games.uid = categories_games.uid
INNER JOIN consoles_games
ON games.uid = consoles_games.uid
WHERE consoleid = 2
AND (categoryid = @categoryid OR @categoryid IS NULL)"
CancelSelectOnNullParameter="false">