Stored Procedures

You can use stored procedures with Adaptive Server ADO.NET Data Provider. The ExecuteReader method is used to call stored procedures that return a result set.

Note: When you retrieve data from the database using a stored procedure, and the stored procedure returns both an output parameter value and a result set, then the result set will be reset and you will be unable to reference result set rows as soon as the output parameter value is referenced. Sybase recommends that in these situations you reference and exhaust all rows in the result set and leave the referencing output parameter value to the end.

The ExecuteNonQuery method is used to call stored procedures that do not return a result set. The ExecuteScalar method is used to call stored procedures that return only a single value.

If the stored procedure requires parameters you must create equivalent AseParameter objects. If you specify that the CommandType is StoredProcedure, set the CommandText to the name of the stored procedure. For example:

sp_producttype
Related concepts
AseParameter Class