Sie sind auf Seite 1von 6

UAS Praktikum Pemrograman Visual

Dhinda Satria Bhakti


19306035
KMA-R31/19

Dhinda Satria Bhakti 19306035


1. Buka Sopftware SQL Server lalu buat database program sembako &
tabel
Toko Sembako

Gambar
Tabel:02

Gambar Database:01

Dhinda Satria Bhakti 19306035


2. Buatlah Project baru dengan software Microsoft Visual Studio lalu buat
di windows From Application lalu buat dengan from sepertiberikut

Gambar Microsoft Visual


Studio:03

3. Kontrol &Komponen

no Kontrol & Komopnen Propeti Nilai


1 Form 1 Text Program toko
sembako
StarPosition Center Screen
2 Lebel1 (Text) Nama Toko
Lebel2 (Text) Nama Barang
Lebel3 (Text) Satuan
Lebel4 (Text) Harga Barang
Lebel5 (Text) Stock
3 TextBox1 (Name) txtToko
TextBox2 (Name) txtBarang
ComboBox 1 (Name) cbSatuan

Dhinda Satria Bhakti 19306035


TextBox3 (Text) Harga Barang
TextBox4 (Text) Stock
4 Button1 (Text) Input
Button2 (Name) btinput
Button3 (Text) Edit
Button4 (Name) btedit
(Text) Delete
(Name) btdelete
(Text) close
btclose
(Name)
5 DataGriveView1 (Name) dgvdata

4. BuatCodingDatasepertidibawahinidanimportsdataSql ServerkeVb.Net
Imports System.Data.SqlClient

Public Class frmSembako

Sub simpan_data()
cmd.Connection = cn
cmd.CommandText = "INSERT INTO Toko_smbako VALUSE ('" & txtToko.Text & "','" &
txtBarang.Text & "','" & cbSatuan.Text & "','" & txtHarga.Text & "','" & txtStock.Text &
"')"
MessageBox.Show("Data Tersimpan")
End Sub

Sub tampil_data()
cmd.Connection = cn
cmd.CommandText = "SELECT * FROM Toko_sembako"

Dim barang As SqlDataReader = cmd.ExecuteReader


Dim data_barang As New DataTable

data_barang.Load(barang)
dgvSembako.DataSource = data_barang

End Sub

Private Sub frmSembako_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
buka_database()
End Sub

Private Sub btinput_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handlesbtinput.Click
simpan_data()
tampil_data()
End Sub

Private Sub btClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles btClose.Click
Dhinda Satria Bhakti 19306035
Dhinda Satria Bhakti 19306035
Close()

End Sub
End Class

5. Dan ini Hasil yang sudah diRuning

GambarRun:04 GambarRun:05

GambarRun:06 GambarRun:07

Dhinda Satria Bhakti 19306035