SMK TAKHASSUS AL-QUR’AN WONOSOBO
PROCEDURE TEXT
HOW TO MAKE LOGIN FORM IN VISUAL STUDIO WITH
MDF DATABASE(LOCAL DATABASE)
MEMBERS OF THE GROUP
1. Azka Yan Zakarya
2. Miko Febrian
3. Syahdan Farisqi
XI PPLG 4
9 FEBRUARI 2024
Softwrae needed
1. Visual studio 2015
2. SQL server Management Studio
Steps to make login form in visual studio 2015
1. Open visual studio and create new project
2. Select windows form application,than change name to
“LoginApp” , select directory APP and click OK
3. Open SQL server Management studio create new
database
4. Change database name to “DB_APP”
5. After that create new table with field like this and click
enter, Change table name to “Table_Pengguna” and
enter,
6. Next, you must detach your database to move this
database into app folder directory
7. Paste the database to this directrory file, so that file can
be read by the program
8. Open back visual studio,after that create a new class
“koneksi.cs”
9. Write this code in koneksi.cs class
Using System.Data.Sqlclient;
Class koneksi
Public SqlConnection GettConn()
String directory = Appdomain.CurrentDomain.BaseDirectory;
String filename = “DB_APP.mdf”;
SqlConnection conn = new SqlConnection(@”Data Source=(LocalDB)\\
MSSQLLocalDB;AttachDbFilename”+directory+filename+”;Integarted Security=true”;
Return conn;
}
10. Design windows form like this
11. Click button login 2x to get event args(button on
click),and type this code
12. Finished, you can test this application by click F5 on
keyboard , the result is like this