I have a method that reads from a table (X) 3 values and sends them to a StoreProceduces as many times as records have the table (x)
so what I do is the following:
foreach (var item in resultado)
{
cmd.Parameters.Add("@Id", SqlDbType.Int).Value = item.Id;
cmd.Parameters.Add("@Valor", SqlDbType.Decimal).Value = item.Valor;
cmd.Parameters.Add("@LastUpdate", SqlDbType.DateTime).Value = DateTime.Now;
}
cmd.ExecuteNonQuery();
The problem is that I get an error:
The sp_UPDATE function or procedure has too many arguments.