Create a command object and add a parameter to the Parameters collection, marked as a return value. Something like this:
SqlParameter param = new SqlParameter("@.ret_val", SqlDbType.Int);
param.Direction = ParameterDirection.ReturnValue;
myCmd.Parameters.Add(param);
Then make the call to the stored proce, and read the value of @.ret_val (or whatever you call it):
int32 ret = myCmd.Parameters("@.ret_val").Value;
I typed this from memory, so the code might require tweaking.
Don|||Hi, i want to returen one value (integer) from table to send this value to anather waiting quary how i can do this (in aspx page with c#) . thanks|||From my last post, take the value in ret and pass it to a new query.
Is that what you mean? Or what am I not understanding?
Donsql
No comments:
Post a Comment