I am sending ID as outparameter but its giving error
System.Data.SqlClient.SqlException: Procedure or function 'usp_ClientHistoryItem' expects parameter '@ID', which was not supplied.
Code
using (SqlCommand cmd = new SqlCommand("dbo.usp_ClientHistoryItem", conn))
{
SqlParameter parameterID = new SqlParameter("@ID", oReservation.Id);
parameterID.Direction = ParameterDirection.Output;
cmd.Parameters.Add(parameterID);
cmd.Parameters.Add(new SqlParameter("@PhoneNo", oReservation.ClientPhone));
cmd.Parameters.Add(new SqlParameter("@UserId", oReservation.UserID));
cmd.Parameters.Add(new SqlParameter("@Description", oReservation.Description));
cmd.Parameters.Add(new SqlParameter("@TestId", oReservation.TestId));
cmd.Parameters.Add(new SqlParameter("@StartDate", oReservation.StartDate));
cmd.ExecuteNonQuery();
returnValue = Convert.ToInt32(cmd.Parameters["@ID"].Value);
return returnValue;
}