private void btnLogin_Click(object sender, EventArgs e)
{
Form1 frm = new Form1();
string sql = "SELECT * From Admin WHERE UserName='" + txtUserName.Text + "' And Password='"+txtPassword.Text+"'";
if (conn2.State != ConnectionState.Open)
{
conn2.Open();
}
command = new SqlCommand(sql, conn2);
SqlDataReader reader = command.ExecuteReader();
reader.Read();
if (reader.HasRows)
{
if(reader[0]==txtUserName.Text && reader[1]==txtPassword.Text)
{
// I want the code in this section
}
}
}
I want to activate the "edit tabpage" when the login suceeds . The "edit page " is in other form.