Ejemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            string        st  = "data source=puneeth;initial catalog=sai;integrated security=true";
            SqlConnection con = new SqlConnection(st);

            con.Open();
            string        str = "select * from log123 where login='******'and password='******'";
            SqlCommand    cmd = new SqlCommand(str, con);
            SqlDataReader dr  = cmd.ExecuteReader();

            if (dr.HasRows)
            {
                dr.Read();
                int   a  = Convert.ToInt32(dr.GetValue(3));
                Form7 f7 = new Form7(a);
                this.Hide();
                f7.ShowDialog();
            }
            else
            {
                MessageBox.Show("invalid user");
                con.Close();
            }
        }
Ejemplo n.º 2
0
        private void button7_Click(object sender, EventArgs e)
        {
            Form7 f = new Form7();

            f.ShowDialog();
        }