尝试通过存储过程更新数据库中的行时出现此错误
过程或函数“sp_A_Update”需要未提供的参数“@Misc”。
但我已经提供了这个:
command.Parameters.AddWithValue("@Misc", inspection.Misc);
这是我的整个代码,其中删除了其他参数以缩短
using (SqlCommand command = new SqlCommand("sp_Agent_Inspection_Update", new SqlConnection (Configuration.ConnectionString)))
{
command.CommandType = CommandType.StoredProcedure;
PropertyInfo[] propertyInfo = inspection.GetType().GetProperties();
command.Parameters.AddWithValue("@Misc", inspection.Misc);
(lots of other params here...)
command.Parameters.AddWithValue("@RepairNotes", inspection.RepairNotes);
// OPEN CONNECTION
command.Connection.Open();
// EXECUTE QUERY
int rowsAffected = command.ExecuteNonQuery();
command.Connection.Close();
return Boolean.Parse(rowsAffected.ToString());
}
有没有人有任何想法?