Hope you can help me with this.
I'd like to filter my datagridview
by using a certain keyword like a name for example.
I used a data set then bind it to a data source then to my datagridview
for viewing.
When I used the bindingsource.filter
I can't get any result.
Here is my code:
Dim ds As New DataSet
Dim bs As New BindingSource
Dim sql As String = "SELECT TOP 10 * FROM dbo.DimCustomer"
Dim connection As New SqlConnection(sqlconnectionstring)
Dim dataadapter As New SqlDataAdapter(sql, connection)
connection.Open()
ds.Clear()
dataadapter.Fill(ds, "Customer")
connection.Close()
bs.DataSource = ds
dgv1.DataSource = bs
dgv1.DataMember = "Customer"
bs.Filter = "FirstName = 'Jon'"