You develop an inventory management application called XYZManagement that will call aMicrosoft SQL Server stored procedure named sp_GetDailyXYZSales. The stored procedure will run a query that returns your daily sales total as an output parameter.This total will be displayed to users in a message box. Your application uses a SqlCommand object to run sp_GetDailyXYZSales. You write thefollowing code to call sp_GetDailyXYZSales:SqlConnection cnn = new SqlConnection(myConnString);SqlCommand cmd = new SqlCommand(“sp_GetDaily XYZ Sales”, cnn);cmd.CommandType = CommandType.StoredProcedure;SqlParameter prm = cmd.Parameters.Add(“@ItemTotal”,SqlDbType.Int);prm.Direction = ParameterDirection.Output;cnn.Open();cmd.ExecuteNonQuery(); Now you must write additional code to access the output parameter. Which code segment should you use?
💬 Comments (0)