• Halim Dahlan (12/5/2007)


    Hi,

    I'm new to ASP.NET and ADO.NET and was just trying out SqlParameter. How do I use SqlParameter to get a return code along with other parameters (input). I have a stored procedure that accepts some parameters to insert new record in a table.

    I need to get the return code whether my insert execution is successful or not. So how do I get the return code?

    Thanks in a million.

    Sorry I don't usually use myself but as I recall if you have a return code the parameter collection of the SqlCommand object will contain it in the 0 item or @ret item so something like this in C# (assuming your SqlCommand object is named cmdSQL)

    cmdSQL.Parameters[0]...

    or

    cmdSQL.Parameters["@ret"]...