Dear All
I am calling the store procedure from my .net code
that store procedure return 0 if successfull and
return 1 if fails
Please could you tell me how can i return this 0 or 1 to my .NET code
Many Thanks in advance
salih
Printable View
Dear All
I am calling the store procedure from my .net code
that store procedure return 0 if successfull and
return 1 if fails
Please could you tell me how can i return this 0 or 1 to my .NET code
Many Thanks in advance
salih
You need to add a return value paramater to your parameter collection.
I think it also has to be the 1st one.
Something like:
Code:Dim myParm As SqlClient.SqlParameter
myParm = myCmd.Parameters.Add("RETURN_VALUE", SqlDbType.Int)
myParm.Direction = ParameterDirection.ReturnValue
No, it doesn't have to be the first parameter in the collection. I usually put my return value as the last one in the collection. You can put it anywhere, but it is better practice to put it as the first or last in the collection.Quote:
I think it also has to be the 1st one.