private void button2_Click(object sender, EventArgs e) { Function.CekTextboxComboBox(this, errorProvider1); this.Text = Function.KOSONGTEXT.ToString() + " " + Function.KOSONGKOMBO.ToString(); if ((Function.KOSONGTEXT == false) & (Function.KOSONGKOMBO == false)) { MySql.QUERY = "SELECT * FROM t_user WHERE username='******'"; MySql.Reader(MySql.QUERY); if (MySql.ReaderHasRow == true) { if (input_md5_pass.Text == MySql.ReaderData[2]) { Function.USERDATA[0] = MySql.ReaderData[1]; Function.USERDATA[1] = MySql.ReaderData[3]; Function.USERDATA[2] = MySql.ReaderData[4]; Function.ClearTextBoxComboBox(this); Function.Pesan.Pupup("Berhasil Login !\n - Username : "******"\n - Nama : " + Function.USERDATA[1] + "\n - Level : " + Function.USERDATA[2]); MySql.ShowDataQuery("SELECT * FROM t_user", dataGridView1); } else { errorProvider1.SetError(input_md5_pass, "Password Salah !"); input_md5_pass.Select(); input_md5_pass.SelectAll(); } } else { errorProvider1.SetError(input_user, "Username Tidak ditemukan !"); input_user.Select(); input_user.SelectAll(); } } }
private void button1_Click(object sender, EventArgs e) { MySql.Reader("select * from t_user where username= '******'"); Function.Pesan.Info(MySql.ReaderData[3]); }