The two most common issues in calling an SP from C# are:
The first is not passing in required parameters, as OriginalGriff states in the other answer.
The second is failing to set the
SqlCommand.CommandType
in which case it will default to Text.
using (SqlConnection conn = new SqlConnection(connectionString)) {
using (SqlCommand cmd = new SqlCommand({ProcedureName}, conn)) {
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@ParameterName", ParameterValue);
}
}
SqlCommand.CommandType Property (System.Data.SqlClient) | Microsoft Docs[
^]