Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. Using conn = New OleDbConnection(connstring)
  2. Try
  3. Dim Sql As String = "SELECT * FROM Products WHERE [Product Name] LIKE '" & txtSearchProduct.Text & "*'"
  4.  
  5. Dim da As New OleDbDataAdapter(Sql, conn)
  6. Dim ds As New DataSet
  7. da.Fill(ds)
  8. DataGridView2.DataSource = ds.Tables(0)
  9.  
  10. Catch ex As Exception
  11. MsgBox(ex.ToString, MsgBoxStyle.OkOnly Or MsgBoxStyle.Exclamation, "Error")
  12. End Try
  13. End Using
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement