Esempio n. 1
0
 private void btnsearch_Click(object sender, EventArgs e)
 {
     try
     {
         string    sql = "select * from Emp1";
         DataTable dt  = DataGenericFile.GetTable(sql);
         dgvtable.DataSource = dt;
         dgvtable.Refresh();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Esempio n. 2
0
        private void btnlogin_Click(object sender, EventArgs e)
        {
            Login fmlogin = new Login();

            if (fmlogin.ShowDialog() == DialogResult.OK)
            {
                string sql = " select username from users " + "where username = '******' and " +
                             "password = '******' ";
                object obj = DataGenericFile.GetSingleAnswer(sql);
                if (obj != null)
                {
                    MessageBox.Show("Login Succesfull....");
                }
                else
                {
                    MessageBox.Show("Try again...");
                }
            }
        }