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

ConaWendyPostNo 1

The program will automatically loads database table into a listbox control and the selected value in the listbox will appear in DataGridView.

Uploaded by

Wendy Cona
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)
39 views

ConaWendyPostNo 1

The program will automatically loads database table into a listbox control and the selected value in the listbox will appear in DataGridView.

Uploaded by

Wendy Cona
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/ 15

POST No.

1:
The program will automatically loads
database table into a listbox control and
the selected value in the listbox will
appear in DataGridView.
Cona, Wendy
BSIT3_b1

Step 1. Open Visual Studio 2012

Step 2. click new Project

Step 3. Select Visual C# then Windows Forms Application


Then click OK button.

You can edit


the name of
project

Step 4.Create a form like this, drag the selected listBox to the form, and also The
Datagridview from the ToolBox
ListBox1

You can edit the name of lisbox and datagridview


by selecting Listbox or Datagridview in properties.

Datagridview1

Step 5.Select the name of project here, then right click select Add then click Class.
Select Visual C# Items then select Class and
Name the class as DBConnect.cs after that click Add button
below dont forget the extension .cs and the click Add button.

Step 6. this step is almost the to step 5 except the name of the class,
Select the name of your project here, then select Add after that click
Class.
Select Visual C# Items then select Class and
Name the class as ClassStudents.cs after that click Add
button below.
Step 7. Select Reference in solution Explorer and then select 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
After that select the MySql.Data.dll
And MySql.Data.Entity.dll

Step 8. Go to Desktop, Open the MySQL Workbench


Use the password: admin if necessary.
Then click Data Import/Restore you can browse it just click the
button.
1.

Select this
2.

3.

Click this button


4.

Step 9. Heres the coding portion, go back to the Visual Studio 2012 Application and go to
DBConnect.cs and insert this code.

Insert this
code
Start coding
here

Coding continue

Step 9. Go to your form1.cs double click form and code this.

Insert this

Start coding here

Code continue

Step 10. F5 to run the program. Output will be like this.

ThankYou
Hope you like it.
References/installer:

You might also like