Hi!
I have on my form one label (lblMsgSend) with the text "Sended". I need with these codes when there datas that already exist it cant show this label's message "Sended".
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;
ThrishPosted Mar 4, 2016, 3:05 PM
IsraelPosted Mar 4, 2016, 12:14 PM
ThrishPosted Mar 4, 2016, 10:19 AM
IsraelPosted Mar 4, 2016, 7:12 AM
Ravi PatelPosted Mar 4, 2016, 2:40 AM
Amit KumarPosted Mar 4, 2016, 12:44 AM
ali tuncerPosted Mar 4, 2016, 12:34 AM
}
{
}