how to Call a Parameterized Stored Procedure by Using ADO.NET and Visual C# .NET?
Thursday, April 10th, 2008There are several ways to use ADO.NET to call a stored procedure and to get
back return values and return parameters, including:
•Use a DataSet object to gather the returned rows and to work with these rows in addition to the return values and the return parameters.
•Use a DataReader object to gather the returned rows, to move through these rows, and then to gather return values and return parameters.
•Use the ExecuteScalar method to return the value from the first column of the results’ first row with the return values and the return parameters. This is most useful with aggregate functions.
•Use the ExecuteNonQuery method to return only the return parameters and the return values. Any returned rows are discarded. This is most useful for executing action queries.