private void btn_refresh_Click(object sender, EventArgs e) { // Data Grid View ManageUser vu = new ManageUser(); DataTable dt = vu.Select_user(); dataGridView1.DataSource = dt; }
private void ManageUser_Load(object sender, EventArgs e) { // Data Grid View ManageUser vu = new ManageUser(); DataTable dt = vu.Select_user(); dataGridView1.DataSource = dt; }
private void text_search_TextChanged(object sender, EventArgs e) { //Get keyword from textbox string keyword = text_search.Text; ManageUser vu1 = new ManageUser(); //Check if keywords have value or not if (keyword != null) { //show user based based on keywords DataTable dt = vu1.Search(keyword); dataGridView1.DataSource = dt; } else { //show all user from database DataTable dt = vu1.Select_user(); dataGridView1.DataSource = dt; } }