I have an employee name textbox and a login button when i click on login buton for a user only once the current date with empname should be stored in SQL SERVER I NEED THE LOGIC
private void btn_itLogin_Click(object sender, EventArgs e)
{
//if(txt_iwdEname.Text!="")
// {
//DateTime dt = new DateTime();
//dt = DateTime.Now;
selectQueryString = "insert into tb_empInTime(Emname,Empindate,Empintime) values('" +
txt_iwdEname.Text + "','" + DateTime.Now + "','"+DateTime.Now+"')";
ExecQuery();
MessageBox.Show("You have Logged in \n Have a nice day", txt_iwdEname.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
// }
}
else
{
MessageBox.Show("You have already logged in", "Alert", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
By this code i am getting a user login info multiple times per day i need only once

ali tuncerRank #1,498 · 1.1K reputationPosted Sep 23, 2016, 2:01 AM EDT
Delpin Susai RajRank #53 · 29.5K reputationPosted Sep 21, 2016, 3:45 AM EDT