In the code below I add 1 to each step in the variable i
, to add 30 days in the dt
field, do I need another for
or what to do in it?
DbConnection cnx = ADO_Utils.GetConnection();
DbCommand cmd = ADO_Utils.GetComando(cnx);
cmd.CommandType = CommandType.Text;
for (var i = 1; i < Convert.ToInt32(txbQtde.Text); i++) { // <==== note que não tem o ;
cmd.CommandText = @"insert into tblAcordoParcel (txtCPF, intParcela, dblValorParcel,
dtVencimento, blnBaixada) Values (@cpf, @i, @parcel, @dt, 0)";
cmd.Parameters.AddWithValue("@cpf", cpf);
cmd.Parameters.AddWithValue("@i", i);
cmd.Parameters.AddWithValue("@parcel", txbParcel.Text);
cmd.Parameters.AddWithValue("@dt", txbDt.Text);
cmd.ExecuteNonQuery();