Searching Columns Value in MS Access Using VB.Net

0
189

This tutorial is all about Searching Columns Value in MS Access Using VB.Net. In this post i will teach you on Searching Columns Value in MS Access Using VB.Net. So let’s get started:

As a continuation of this tutorial. We will use the Displaying Data Table Records in Datagridview using VB.Net

  • First, Design your Form like this one below.
    Add a Textbox and a Button.

  • After designing the form add this following declaration.
    1. Public dbdt As New DataTable
  • Click the Search Button and Add this code.
    1. Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
    2. TryMyconnection.Open()
    3. dbdt = New DataTable
    4.  
    5. With dbcmd
    6. .Connection = Myconnection
    7. .CommandText = "Select * from tblitems where ITEMNAME like '" & TextBox4.Text & "%'"
    8. End With
    9.  
    10. dbda.SelectCommand = dbcmd
    11. dbda.Fill(dbdt)
    12.  
    13. DataGridView1.DataSource = dbdt
    14.  
    15. Catch ex As Exception
    16. MsgBox(ex.Message)
    17. End Try
    18. dbda.Dispose()
    19.  
    20. Myconnection.Close()
    21. End Sub
  • Then Click F5 to Run the Program.
    Output.

 

 

If you have any comments or suggestions about on Searching Columns Value in MS Access Using VB.Net, please feel free to contact our webpage.

Download Searching Columns Value in MS Access Using VB.Net Here

Other Articles Readers might read:

 

Facebook Comments
(Visited 206 times, 1 visits today)

LEAVE A REPLY

Please enter your comment!
Please enter your name here