0% found this document useful (0 votes)
19 views

Create A Program That Is Able To Search Multiple Values From Listbox

This 3-step summary provides the essential information to create a program that can search multiple values from a listbox: 1. Design a Windows form with a listbox, datagridview, and button. Add items to the listbox and connect to a MySQL database using classes. 2. Import sample data from the "psu.sql" file into the Local MySQL instance using MySQL Workbench. 3. Add code to search the database when the button is clicked and display results in the datagridview.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

Create A Program That Is Able To Search Multiple Values From Listbox

This 3-step summary provides the essential information to create a program that can search multiple values from a listbox: 1. Design a Windows form with a listbox, datagridview, and button. Add items to the listbox and connect to a MySQL database using classes. 2. Import sample data from the "psu.sql" file into the Local MySQL instance using MySQL Workbench. 3. Add code to search the database when the button is clicked and display results in the datagridview.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 25

POST #4:

CREATE A PROGRAM THAT IS


ABLE TO SEARCH MULTIPLE
VALUES FROM LISTBOX.
Prepared by:
Camille Kimberly M. Flores
IT3_B1

Step 1. Open the Visual Studio 2010 or C# Application

Step 2. Click new project on the left side

Click

Step 3. Select Windows Forms Application

You can edit the name of the project

Click OK to move

This is the form that you can design your work.


Toolbox

Solution Explorer

You can choose an item


for you work and design.

Properties
You can edit the name, font,
Color, etc. here.

Step 4. Create a form like this, find it at the tool box

listBox
dataGridView
Button

You can edit the name of the lisbox,button and


datagridview by selecting Listbox,button or
Datagridview and select properties

Step 5: Click the listBox and go to properties of it and click collection

Step 6: Then click collection


Click the listBox

Step 7: Then type


this and click
OK
Type this

Step 8.Select the name of your project here, then select Add after that click Class.

Right click then click


add and class

Step 9: Select Class and name the class as DBConnect.cs after that click Add button below.

Click

Edit the name as DBConnect.cs

Click

Step 10: Type the codes

To connect the C# in your


database workbench

Step 11. Repeat adding a class

Right click then click


add and class

Step 12: Select Class and name the class as ClassStudents.cs after that click Add button below.

Click

Edit the name as ClassStudents.cs

Click

Step 13: Type the codes

Same input from the


database workbench

Step 14: Go to solution Explorer then right click REFERENCES and Add reference

Click browse then go to


C:\Program Files (x86)\MySQL\Connector NET
6.7.4\Assemblies\v4.5
If v4.5 didn't work choose v2.0 or v4.0 version

Click

After that select the MySql.Data.dll


And MySql.Data.Entity.dll

Click

Step 15. Go to Desktop and Open the MySQL Workbench application if you dont have then try to
install the installer inside the folder of DATABASE , then use password: admin when the
installation is near to complete, after that open the MySQL Workbench application then click or
open the Local instance then type the password: admin after that, go to management. Then select
Data Import/Restore and follow the Instruction below.

Click this first

Then second
click this

Then Click and attach the


psu.sql here

Click start
import

Step 16. Go back to your C# application,


double click the FORM 1 in design.

Double click

Step 17. Type this codes

Step 18. F5 to run the program


Click what year then click the button search

Reference of the program:

THANK YOU VERY MUCH !!

You might also like