예제 #1
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            String user = txtUser.Text;
            String pass = txtPass.Text;

            if (user.Length > 0 && pass.Length > 0)
            {
                String sql = String.Format("SELECT p.* FROM persona p " +
                                           "WHERE docPersona = '{0}' AND password = '******'", user, pass);
                DataTable tab = Conexion.Data(sql);
                if (tab.Rows.Count > 0)
                {
                    MessageBox.Show("Bienvenido: " + tab.Columns[2]);
                    new Menu().Show();
                }
            }
            else
            {
                MessageBox.Show("Ingresa el Usuario o contraseña", "Verifica", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }