You are on page 1of 4

19306054

Rizal Misbach Asya


KMA-R31/19

Tugas Praktikum
Visual Basic
Pertemuan 11-13
1. Vb.Net

Toolbox & Propertis

no objek Propertis Nilai propertis


1 From1 Name frmastersupplier
2 GroupBox1 Text Input Data
Lebel1 s/d lebel4 Text Saporti di form
TextBox1 Name Saporti di form
TextBox2 Name Txtkodesupplier
TextBox3 Name Txtnamasupplier
TextBox4 Name Txtalamat
txttelepon
3 GroupBox2 Text
Battom1 Name btnNew
Text
Battom2 Name BtnSave
Text
Battom3 Name BtnCencel
Text
Battom4 Name BtnClose
Text
Name
4 DataGrideView1 name dgvinpitData
Coding

Imports System.Data.SqlClient
Public Class frMasterSupplaier
Dim conn As SqlConnection
Dim Da As SqlDataAdapter
Dim Cad As SqlCommand
Dim Rd As SqlDataReader
Dim Ds As DataSet
Dim MyDB As String
Sub koneksi()
MyDB = "data source= WINDOWS-Q77924U;initial catalog=Penjualan Barang;integrated security=true"
conn = New SqlConnection(MyDB)
If conn.State = ConnectionState.Closed Then conn.Open()
End Sub
Sub KondisiAwal()
Call koneksi()
Da = New SqlDataAdapter("select * from Master_Supplier", conn)
Ds = New DataSet
Ds.Clear()
Da.Fill(Ds, "Master_Supplier")
DgvBarang.DataSource = (Ds.Tables("Master_Supplier"))
End Sub

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


Btsave.Click
MsgBox("Data Sudah Disimpan", MsgBoxStyle.Information, "Perhatian")
End Sub

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


Btcencel.Click
MsgBox("Data Sudah digagalkan", MsgBoxStyle.Information, "Perhatian")
End Sub

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


BtNew.Click
MsgBox("Data Baru", MsgBoxStyle.Information, "Perhatian")
End Sub

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


Btclose.Click
Me.Close()
End Sub

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


MyBase.Load
Call KondisiAwal()
End Sub
End Class
Database SQL SERVER

Finish

You might also like