In your Stored Proc you have a parameter
@CatID
, a value for which, I assume, should be passed to it from your code. No value is being passed.
Then once your stored proc is run the parameter is not used anyway.
Computers are not mind readers, you have to tell them
exactly what to do.
To start you off I would suggest that you add a
WHERE
clause to your stored proc to utilise the
@CatID
passed in.
Then do some research on
parameterized queries, possibly start
here[
^].
Good luck! :)