I did that, without success....
my code:
First attempt:
Code:
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'VBTestDataSet.Customer' table. You can move, or remove it, as needed.
Me.CustomerTableAdapter.Fill(Me.VBTestDataSet.Customer)
'TODO: This line of code loads data into the 'VBTestDataSet.Invoices' table. You can move, or remove it, as needed.
Me.InvoicesTableAdapter.Fill(Me.VBTestDataSet.Invoices)
Me.DataGridView1.Visible = False
End Sub
Private Sub ComboBox1_ValueMember(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
Me.BindingSource1.Filter = "CID =" & ComboBox1.ValueMember
Me.DataGridView1.Visible = True
End Sub
End Class
Nothing happened... no filtering
Second Attempt:
Code:
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'VBTestDataSet.Customer' table. You can move, or remove it, as needed.
Me.CustomerTableAdapter.Fill(Me.VBTestDataSet.Customer)
'TODO: This line of code loads data into the 'VBTestDataSet.Invoices' table. You can move, or remove it, as needed.
Me.InvoicesTableAdapter.Fill(Me.VBTestDataSet.Invoices)
Me.DataGridView1.Visible = False
End Sub
Private Sub ComboBox1_ValueMemberChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
Me.InvoicesBindingSource.Filter = "CID =" & ComboBox1.ValueMember
Me.DataGridView1.Visible = True
End Sub
End Class
Error: "Syntax error: Missing operand after '=' operator."
I attached the vb project and database...