This can be done with a stored procedure and defining an output parameter like so
CREATE PROCEDURE [someprocedure]
(
@Rows int output
)
SET @Rows = @@ROWCOUNT
then just deal with it in code.
this post may help you as well:
http://www.dotnet247.com/247reference/msgs/5/25190.aspx
"The one language all programmers understand is profanity."