private void btn_refresh_Click(object sender, EventArgs e) { ViewUsers vu = new ViewUsers(); DataTable dt = vu.Select_user(); dataGridView1.DataSource = dt; }
private void ViewUsers_Load(object sender, EventArgs e) { // Data Grid View ViewUsers vu = new ViewUsers(); 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; ViewUsers vu1 = new ViewUsers(); //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; } }