Imports System.Data.OleDb
Public Class ClientsReport

    Dim dbc As New OleDbConnection(conStr)

    Private Sub comboclients()
        Dim dba As New OleDbDataAdapter("SELECT CName FROM tbClient;", dbc)
        Dim dbs As New DataSet
        dba.Fill(dbs)

        Me.ComboBox1.DataSource = dbs.Tables(0).DefaultView
        Me.ComboBox1.DisplayMember = "CName"
    End Sub
    Private Sub ClientsReport_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        comboclients()

    End Sub

   

    Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedIndexChanged
        Dim showcli As New OleDbDataAdapter("SELECT tbSold.ID, tbSold.ClientName, tbSold.ProdID, tbSold.Quantity, tbSold.Price, tbSold.TotBill, tbSold.Payment, tbSold.Change FROM tbSold WHERE tbSold.ClientName='" & Me.ComboBox1.Text & "';", dbc)
        Dim ds As New DataSet
        showcli.Fill(ds)


        Me.DataGridView1.DataSource = ds.Tables(0).DefaultView

    End Sub
End Class