Esempio n. 1
0
        private void btn_refresh_Click(object sender, EventArgs e)
        {
            ViewUsers vu = new ViewUsers();
            DataTable dt = vu.Select_user();

            dataGridView1.DataSource = dt;
        }
Esempio n. 2
0
        private void ViewUsers_Load(object sender, EventArgs e)
        {
            // Data Grid View
            ViewUsers vu = new ViewUsers();
            DataTable dt = vu.Select_user();

            dataGridView1.DataSource = dt;
        }
Esempio n. 3
0
        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;
            }
        }