Upload
ritchie-tungolh
View
229
Download
0
Tags:
Embed Size (px)
DESCRIPTION
making Database step by step procedure
Citation preview
FIGURE 1
This program will input and select data in listbox and it will show in DataGridView.
Step 1. Create New Project in Visual Studio or C# App.
1.1- Open your Microsoft Visual Studio or C# Application in your laptop or desktop.
1.2- Click New Project.
1.3- Click Visual C#.
1.4- Choose Windows Forms Application.
1.5- Click Name: WindowsFormsApplication to edit a name of your project.
1.6- Click OK.
Step 2.Input Item in your C# form.
2.1- When form1 appear in your screen, try to resize the shape .
2.2- Click Toolbox in the left of your Screen and choose the item you want to input
in your form.
2.3- When the items are on the form, right click into one of them and click
Properties.
2.4- In the Properties you will edit the name, color, font, size and etc of the items
you inserted.
Step 3.Adding Class in your Visual C# Form.
3.1- Go to Solution Explorer.
3.2- At the bottom of Solution Explorer, right click in the name of your Visual C#
Form, go to Add and click Class.
Step 4.Adding Reference.
4.1- Almost same in the Step 3, click Add Reference.
4.2- When dialog box show, click Browse and find the location of Mysql.Data.dll that
you want to add.
Step 5. Import Database or Schemas in MySql Workbench.
5.1- On the left side of Workbench or in the Navigator, click Data Import/Restore.
5.2- click the Browse button and find the location of database file.
Step 6.Connect Workbench to Visual Studio using code.
6.1- inset the following Code to connect of each other
Step 7.Continue the following codes.
Step 8.Go to your form1 and insert the following code.
Step 9. Continue the following codes.
Step 10.Try to run your program by pressing f5.
FIGURE 2
This program creates a Log in System that will show any form that you created
in Visual Studio. This log in system has 2 types of user, the admin and staff. If the
user type is admin the form1 will appear and the user type is staff the form2 will
appear.
Step 1. Create a Visual C#.
1.1- Create a new project Microsoft Visual Studio.
1.2 Choose the Window Form Application.
1.3- Input the name of project you want.
1.4- Click Ok.
Step 2.Design your form1 like Log in System.
2.1- To Design your form1 like this, Go to properties and edit the name, font, color
and etc.
Step 3.Adding Forms in your Project.
3.1- Right click at the name of your project and find add, then click Windows form to
add the form2 and form3.
3.2- Choose the Visual C# item.
3.3- Click the Windows Form and rename the form, but make sure that extension file is
.cs
Step 4.Design your form2 for user admin.
4.1- The form2 will be like this. You should design the following description of Log
in System.
4.2- The form3 are same in the form2, the difference is the label for user.
Step 5.Code for Log in system of user admin.
5.1- Double click the form1.
5.2 Copy this code for user admin and try to run by pressing f5.
5.3- Continue coding.
Step 6.Coding for button1 which is the Log in.
6.1- Double click the button1 to view the coding portion.
6.2 Copy the codes for button1.
Step 7.Coding for form3.
7.1- Almost same in the form2, just double click the form3 to show the coding view.
7.2- Copy the code bellow.
Step 8.Try to run the program.
8.1- The username and password for user staff and admin is same.
8.2- If the username and password are incorrect, the dialog box will appear.
8.3- After you Log in using the user staff, you will enter in the form3.
FIGURE 3
This program will show the list of name in DataGridView. The system are able
to search the information of students.
Step 1.Create a Visual C#.
1.2- Create a new project Microsoft Visual Studio.
1.2 Choose the Window Form Application.
1.3- Input the name of project you want.
1.4- Click Ok.
Step 2. Design a form like the image bellow.
2.1- insert the textbox, button and DataGridView.
Step 3.Adding a Class.
3.1- Right click in the name of your form.
3.2- Select Add and click Class.
Step 4.Rename the class that you added.
Step 5.Adding Reference.
6.1- Right click the name of your project and clicks add reference.
6.2- click browse to find the location of your reference or Mysql.dll.
Step 6.Open MySql Workbench.
6.1- In the right side of the workbench click Data Import/Restore.
6.2 Import at the right side of workbench and click browse.
Step 7.Go back in Visual Studio.
7.1- Copy the code bellow in your Db.connect that you create.
7.2- Continue copy the codes bellow.
7.3- Continue copy the codes bellow.
Step 8.Go to your form1.
8.1 copy the following codes bellow.
8.2- Continue copy the codes bellow.
8.3 Continue copy the codes bellow.
8.4- Continue copy the codes bellow.
Step 9. Try to run the program by pressing the f5.
Prepared By: Ritchie Tungolh
IT Student