private void button1_Click(object sender, EventArgs e) { if (textBox3.Text == textBox4.Text) { if (flag == 0) { if (!textBox5.Text.Contains("@")) { MessageBox.Show("Email Formate Not Correct"); } else { ui.UName = textBox2.Text; ui.Pword = textBox3.Text; ui.Igc = 10000; ui.Em = textBox5.Text; ul.InsertUser(ui); MessageBox.Show("Successfull"); frm1.Visible = true; this.Close(); } } else { MessageBox.Show("Username In Use"); } } else { MessageBox.Show("Passwords Didnt Match"); } }