private void Login_Enter_but_Click(object sender, EventArgs e) { this.m.connect.Open(); this.mycmd = "select User_name , Password from Users where User_name='" + Login_YourName_txt.Text + "' and Password='" + login_pass_txt.Text + "'"; this.command= new SqlCommand(this.mycmd,this.m.connect); if (this.command.ExecuteScalar() != null) { this.mycmd = "select U_State from Users where User_name='" + Login_YourName_txt.Text + "' and Password='" + login_pass_txt.Text + "'"; this.command = new SqlCommand(this.mycmd, this.m.connect); string num = this.command.ExecuteScalar().ToString(); if (num == "1") { this.Hide(); Interfaces f = new Interfaces(); f.Show(); //f.tabControl1.TabPages.Remove(tabPage1); f.tabControl1.TabPages[0].Hide(); } else { this.Hide(); Interfaces f = new Interfaces(); f.Show(); } else { MessageBox.Show("Sorry,your name or passwrod are wrong try agian", "Sorry", MessageBoxButtons.OK, MessageBoxIcon.Warning); /* count++; if (count >= 4) { this.Close(); count++; }*/ } m.connect.Close(); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)