Right now when I click to my save's button (even it found datas already exist its show the label's message) . How can I do please.
conn.Open();
OleDbCommand comm = new OleDbCommand();
comm.Connection = conn;
connstr = "SELECT COUNT(*) FROM propTrans WHERE [nome] = @nome";
comm.CommandText = connstr;
comm.Parameters.Clear();
comm.Parameters.AddWithValue("@nome", cbxNomePropinas.Text);
comm.Parameters.AddWithValue("@tipopagamento", cbxTipoPagamentoPropinas.Text);
comm.Parameters.AddWithValue("@mes", cbxMesPropinas.Text);
int numRecords = (int)comm.ExecuteScalar();
if (numRecords == 0)
{
connstr = "INSERT INTO propTrans([nome],[tipopagamento],[mes])VALUES(@nome,@tipopagamento,@mes)";
comm.CommandText = connstr;
comm.Parameters.Clear();
comm.Parameters.AddWithValue("@nome", cbxNomePropinas.Text);
comm.Parameters.AddWithValue("@tipopagamento", cbxTipoPagamentoPropinas.Text);
comm.Parameters.AddWithValue("@mes", cbxMesPropinas.Text);
comm.ExecuteNonQuery();
conn.Close();
/////////////////////////////////////////////////////////////////////////////////
timer1.Start();
lblMsgSend.Visible = true;