Click here to Skip to main content
15,913,610 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dim connection As OleDb.OleDbConnection = New OleDbConnection
      connection.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & System.Environment.CurrentDirectory & "\InventSystem.accdb"
      connection.Open()
      Dim da As String = "SELECT Barcode,ItemName,ItemDescription FROM Items"
      Dim dataadapter As New OleDbDataAdapter(da, connection)
      Dim ds As New DataSet
      Dim dsView As New DataView
      Dim bs As New BindingSource()
      dataadapter.Fill(ds, "Items")
      connection.Close()
      dsView = ds.Tables(0).DefaultView
      bs.DataSource = dsView
      bs.Filter = "Barcode '" & TextBox1.Text & "*' or ItemName'" & TextBox1.Text & "*' or ItemDescription '" & TextBox1.Text & "*'"
      DataGridView1.DataSource = bs
      connection.Close()


What I have tried:

Please help me debug this line of codes
Posted
Updated 24-Feb-17 5:11am

1 solution

the code is missing =

bs.Filter = "Barcode ='" & TextBox1.Text & "*' or ItemName ='" & TextBox1.Text & "*' or ItemDescription ='" & TextBox1.Text & "*'"
 
Share this answer
 
Comments
CaptainChizni 24-Feb-17 11:19am    
now it gets an error system.int32 and system.string
Bryian Tan 24-Feb-17 11:20am    
what the purpose of the * ?
CaptainChizni 24-Feb-17 11:21am    
I remove the * and it works thanks dude :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900