1
In the code below I add 1 to each step in the variable i
, to add 30 days in the field dt
, I need another for
or you can do it yourself?
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();
The solution is simple to give a complete and correct answer I need to know what is the type of column
dtVencimento
.?– Maniero
at that time string, but if it’s easier I know how to switch to datetime
– João K. Queiroz