RATE THIS ANSWER
0
Click to Vote:
0
0
By definition, procedures don't return values. If you want to return the result of your query, you would need to use an output parameter.
On the other hand,
ExecuteNonQuery returns the number of affected rows (for inserts, updates and deletes) or -1, and that's why you are getting the casting error. In this case, it might be more appropriate to use
ExecuteScalar instead.
----------
Stored procedure return values must be numeric. You'll need to pass the object name back as an output parameter or return it as part of a recordset.
Last Answered:
Nov 26 2009 11:06 PM GMT by Mrdenny 
49385 pts.
Latest Contributors: Carlosdl
32725 pts.