private void button2_Click(object sender, EventArgs e) { app b = new app(); b.Show(); this.Close(); }
private void button1_Click(object sender, EventArgs e) { MySqlConnection koneksi = new MySqlConnection("server = localhost;uid = root; database = perpustakaan; pwd = '';"); koneksi.Open(); string nim = textBox1.Text; string pass = textBox2.Text; cmd = new MySqlCommand("select nim,pass from user where nim='" + textBox1.Text + "'and pass='******'", koneksi); MySqlDataAdapter da = new MySqlDataAdapter(cmd); DataTable dt = new DataTable(); da.Fill(dt); if (dt.Rows.Count > 0) { this.getTheName(textBox1.Text); this.Hide(); app fm = new app(); Program.login = textBox1.Text; fm.Show(); } else { MessageBox.Show("NIM ATAU PASSWORD SALAH"); } koneksi.Close(); }