Search DataGridView Using TextBox in VB.Net and MySQL Database

Search DataGridView Using TextBox in VB.Net and MySQL Database

This tutorial is all about How to Search Data in the DataGridView Using a TextBox in VB.Net and MySQL Database. In this tutorial, I will show you how to search for records in VB.Net and MySQL Database.

The list of records in the database will be displayed on the Datagridview and it will show you how easy it is to search a record using a TextBox.

Lets’ begin:

How to search datagridview using textbox vb.net

Step 1: Download the database of this project is located in this link here. (Follow the instructions for creating a database.)

Step 2: After creating a database, open the Visual Basic and create a new Windows Form Application. After that, set the Form just like this.
searchdataform
Step 3: After setting up the Form, double click it and do this code for setting up the connection of MySQL Database to Visual Basic and declare all the classes that are needed above the Form1_Load

 

Note: add mysql.data.dll like your reference to make MySQL work. Follow here the Complete Guide on How to add mysql.data.dll to your vb.net application.

Step 4: Go to Form1_Load and do the following codes for retrieving the record in the database.

Step 5: Go back to the Form Design, double click the “Search” Button and do this code for searching the records in the database.

Download the Code

Download the complete Source Code and run it on your computer searchdatadatagridview

Inquiries

If you have any questions or suggestions about this tutorial on how to Search data in the DataGridView Using TextBox in VB.Net and MySQL Database. Please leave a comment below.

If you want to learn how to master the VB.Net with MySQL Database in 30 minutes, watch and follow the video here.

Readers might read also:

Comments 4 Responses

  1. Andrew Pong December 21, 2015
    • RANDY T. BARING December 19, 2016
  2. RANDY T. BARING December 15, 2016
  3. RANDY T. BARING December 16, 2016

Leave a Comment!

This site uses Akismet to reduce spam. Learn how your comment data is processed.