Mid ADO.NET

Execute the stored procedure using ExecuteNonQuery(), ExecuteReader(), or?

ExecuteScalar() depending on the type of result.

Example:

Follow:

SqlCommand command = new SqlCommand("GetCustomerDetails",

connection);

command.CommandType = CommandType.StoredProcedure;

command.Parameters.AddWithValue("@CustomerID", customerId);

SqlDataReader reader = command.ExecuteReader();

More from ADO.NET Core Tutorial

All questions for this course