using (var con = connection)
{
con.Open();
using (var cmd = new SqlCommand("usp_Students", con))
{
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter sp = cmd.Parameters.AddWithValue("@StudentIDs", studentId);
sp.SqlDbType = SqlDbType.Structured;
cmd.ExecuteNonQuery();
}
}
我正在向存储过程输入一个值,但在这种情况下,我也想取回一个值。我怎样才能在上面的代码中合并输出?
CREATE PROCEDURE usp_Students
@StudentId Students READONLY,
@NumberOfStudents INT OUTPUT,