private void BtnSubmit_Click(object sender, EventArgs e) { SqlConnection cmd = new SqlConnection(cnstr); SqlCommand cm; user = this.TxtUsername.Text; pass = this.TxtPassword.Text; if (String.IsNullOrEmpty(user) || String.IsNullOrWhiteSpace(pass)) { MessageBox.Show("Please enter all details"); } else { cmd.Open(); string xyz = @"select * from Emaillog where Email='" + user + "' and Password='******'"; cm = new SqlCommand(xyz, cmd); SqlDataReader rdr = cm.ExecuteReader(); rdr.Read(); chuser = rdr["Email"].ToString(); chpass = rdr["Password"].ToString(); rdr.Close(); cm.ExecuteNonQuery(); cmd.Close(); MessageBox.Show("Login Successful"); this.Hide(); EmailSender s1 = new EmailSender(); s1.Show(); } }
private void emailSenderToolStripMenuItem_Click(object sender, EventArgs e) { EmailSender s1 = new EmailSender(); s1.Show(); }