There's few ways to achieve that:
1) using filter on DataSet/DataTable through the
Select[
^] method.
See:
Filtering and Sorting in Datasets[
^]
How to: Filter and Sort Directly in Data Tables[
^]
2) using
Filter method[
^] for BindingSource (Caroline -
CHill60[
^] already mentioned about that method)
3) using SqlCommand to grab filtered data from database
You have to use the same code as you use to populate data to DataGridView. The only differ is in
SELECT
statement.
SELECT DATE ,Login ,Operation ,Nbr_docs ,tps_traite ,moy_doc_hr ,moy_sec_doc ,taux_err
from AWB_CHQ_RETOUR
WHERE Login = 'SomeLoginHere'
4) using
Linq to DataSet[
^]
See:
LINQ to DataSet Examples[
^]
101 LINQ Samples in C#[
^]
Creating a DataTable From a Query (LINQ to DataSet)[
^]
DataTable dt = DirectCast(DataGridView1.DataSource, DataTable)
Dim qry = dt.AsEnumerable() _
.Where(Function(x) x.Field(Of String)("Login")="SomeLoginHere")
Dim boundTable As DataTable = qry.CopyToDataTable
DataGridView1.DataSource = boundTable