protected void ShowData(string strFindClient = "") { List <Client> Clients = _db.Clients.Where(s => s.FullName.Contains(strFindClient)).ToList(); GridViewClient.DataSource = Clients; GridViewClient.DataBind(); }
protected void DisplayUserID_Click(object sender, EventArgs e) { conn.Open(); MySqlCommand cmd = conn.CreateCommand(); cmd.CommandType = CommandType.Text; cmd.CommandText = "select user_id, first_name, last_name, username, city, province, gender, age, contactNumber, email, status from client"; cmd.ExecuteNonQuery(); DataTable dtt = new DataTable(); MySqlDataAdapter daa = new MySqlDataAdapter(cmd); daa.Fill(dtt); GridViewClient.DataSource = dtt; GridViewClient.DataBind(); conn.Close(); }