0% found this document useful (0 votes)
106 views7 pages

Visual Studio Login Form Guide

This document provides instructions for creating a login form in Visual Studio using a local MDF database. It is a 10 step process that involves: 1) Creating a Windows form application in Visual Studio, 2) Creating an MDF database in SQL Server Management Studio, 3) Adding a table to the database to store user data, 4) Moving the database file to the Visual Studio project folder, 5) Creating a class to connect to the database, 6) Designing the login form interface in Visual Studio, 7) Adding code to the login button to query the database and authenticate the user, 8) Testing the application. When complete, the login form allows a user to enter credentials which are verified against the local MDF database table

Uploaded by

bosjerukasem
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
106 views7 pages

Visual Studio Login Form Guide

This document provides instructions for creating a login form in Visual Studio using a local MDF database. It is a 10 step process that involves: 1) Creating a Windows form application in Visual Studio, 2) Creating an MDF database in SQL Server Management Studio, 3) Adding a table to the database to store user data, 4) Moving the database file to the Visual Studio project folder, 5) Creating a class to connect to the database, 6) Designing the login form interface in Visual Studio, 7) Adding code to the login button to query the database and authenticate the user, 8) Testing the application. When complete, the login form allows a user to enter credentials which are verified against the local MDF database table

Uploaded by

bosjerukasem
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

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

You might also like