Public Class LATIHAN032C_46109010 Dim rossi As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet oledb:database password=46")
Private Sub simpan46109010_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles simpan46109010.Click If t146109010.Text.Length = 0 Then MsgBox("Isi text yang kosong") Exit Sub End If
If t246109010.Text.Length = 0 Then MsgBox("Isi text yang kosong") Exit Sub End If
If Val(t346109010.Text) = 0 Then MsgBox("Isi text yang kosong") Exit Sub End If
If Val(t446109010.Text) = 0 Then MsgBox("Isi text yang kosong") Exit Sub End If Dim vr As New OleDb.OleDbCommand
Dim risky As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; Data Source=" & Application.StartupPath & "\DATABARANG.accdb;jet oledb:database password=kiki") Dim ambil As New DataTable
Private Sub Latihan_32A_022_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim mahira As New OleDb.OleDbDataAdapter mahira = New OleDb.OleDbDataAdapter("SELECT * FROM BARANG", risky) mahira.Fill(ambil) DGV_46109050.DataSource = ambil
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If Latihan32C_46109050.Visible = False Then Latihan32C_46109050.Show() Else Latihan32C_46109050.Activate() End If
Latihan32C_46109050.ToolStripStatusLabel1.Text = "kode barang lama = " & DGV_46109050.CurrentRow.Cells("kodebarang").Value Latihan32C_46109050.QQ1_46109050.Text = DGV_46109050.CurrentRow.Cells("kodebarang").Value Latihan32C_46109050.QQ2_46109050.Text = DGV_46109050.CurrentRow.Cells("namabarang").Value Latihan32C_46109050.QQ3_46109050.Text = DGV_46109050.CurrentRow.Cells("hargajual").Value Latihan32C_46109050.QQ4_46109050.Text = DGV_46109050.CurrentRow.Cells("jumlahbarang").Value End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click If Latihan32B_46109050.Visible = False Then Latihan32B_46109050.Show() Else Latihan32B_46109050.Activate() End If End Sub End Class
Dim risky As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; Data Source=" & Application.StartupPath & "\DATABARANG.accdb;jet oledb:database password=kiki")
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If Val(QQ1_46109050.Text) = 0 Then MsgBox("Kode barang belum terisi") Exit Sub End If
If QQ2_46109050.Text.Length = 0 Then MsgBox("Kode barang belum terisi") Exit Sub End If
If Val(QQ3_46109050.Text) = 0 Then MsgBox("Kode barang belum terisi") Exit Sub End If
If Val(QQ4_46109050.Text) = 0 Then MsgBox("Kode barang belum terisi") Exit Sub End If
Dim mahira As New OleDb.OleDbCommand mahira = New OleDb.OleDbCommand("PsTambahBarang", risky) mahira.CommandType = CommandType.StoredProcedure mahira.Parameters.Add(New OleDb.OleDbParameter("pKodeBarang", QQ1_46109050.Text)) mahira.Parameters.Add(New OleDb.OleDbParameter("pNamaBarang", QQ2_46109050.Text)) mahira.Parameters.Add(New OleDb.OleDbParameter("pPersawal", QQ3_46109050.Text)) mahira.Parameters.Add(New OleDb.OleDbParameter("pHargaJual", QQ4_46109050.Text))
Dim risky As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; Data Source=" & Application.StartupPath & "\DATABARANG.accdb;jet oledb:database password=kiki")
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If Val(QQ1_46109050.Text) = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If
If Val(QQ2_46109050.Text) = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If
If Val(QQ3_46109050.Text) = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If
If Val(QQ4_46109050.Text) = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If
Dim mahira As New OleDb.OleDbCommand mahira = New OleDb.OleDbCommand("UPDATE BARANG SET kodebarang = '" & QQ1_46109050.Text & "', namabarang = '" & QQ2_46109050.Text & "', hargajual = " & Val(QQ3_46109050.Text) & ", jumlahbarang = " & Val(QQ4_46109050.Text) & " where odebarang = '" & ToolStripStatusLabel1.Text & "'", risky)
Public Class LATIHAN032B_46109006 Dim sry As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet oledb:database password=10")
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If KB.Text.Length = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If
If NB.Text.Length = 0 Then MsgBox("nama barang belum terisi") Exit Sub End If
If Val(HJ.Text) = 0 Then MsgBox("harga jual belum terisi") Exit Sub End If
If Val(JB.Text) = 0 Then MsgBox("jumlah barang belum terisi") Exit Sub End If
Dim ki2 As New OleDb.OleDbCommand Ki2 = New OleDb.OleDbCommand("PsTAMBAHBARANG", sry) ki2.CommandType = CommandType.StoredProcedure ki2.Parameters.Add(New OleDb.OleDbParameter("pKODEBARANG", KB.Text)) ki2.Parameters.Add(New OleDb.OleDbParameter("pNAMABARANG", NB.Text)) ki2.Parameters.Add(New OleDb.OleDbParameter("pPERSEDIAANAWAL", Val(HJ.Text))) ki2.Parameters.Add(New OleDb.OleDbParameter("pHARGAJUAL", Val(JB.Text))) sry.Open() ki2.ExecuteNonQuery() sry.Close() ki2.Dispose()
Public Class LATIHAN032C_46109006 Dim SRY As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet oledb:database password=10")
Private Sub simpan46109006_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles simpan46109006.Click If KB.Text.Length = 0 Then MsgBox("Isi text yang kosong") Exit Sub End If
If NB.Text.Length = 0 Then MsgBox("Isi text yang kosong") Exit Sub End If
If Val(HJ.Text) = 0 Then MsgBox("Isi text yang kosong") Exit Sub End If
If Val(JB.Text) = 0 Then MsgBox("Isi text yang kosong") Exit Sub End If
Dim KI2 As New OleDb.OleDbCommand KI2 = New OleDb.OleDbCommand("update barang set kodebarang = '" & KB.Text & "', namabarang = '" & NB.Text & "', hargajual = " & Val(HJ.Text) & ", jumlahbarang = " & Val(JB.Text) & " where kodebarang = '" & ToolStripStatusLabel1.Text & "'", SRY) SRY.Open() KI2.ExecuteNonQuery() SRY.Close() KI2.Dispose()
KB.Text = "" NB.Text = "" HJ.Text = "" JB.Text = "" End Sub End Class
Dim itha As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:database password=979264") Dim ambil As New DataTable
Private Sub Latihan32A46109047_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim muhitha As New OleDb.OleDbDataAdapter muhitha = New OleDb.OleDbDataAdapter("SELECT * FROM BARANG", itha) muhitha.Fill(ambil) DGV46109047.DataSource = ambil
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If Latihan32C46109047.Visible = False Then Latihan32C46109047.Show() Else Latihan32C46109047.Activate() End If
Latihan32C46109047.ToolStripStatusLabel1.Text = "kode barang lama = " & DGV46109047.CurrentRow.Cells("kodebarang").Value Latihan32C46109047.TB146109047.Text = DGV46109047.CurrentRow.Cells("kodebarang").Value Latihan32C46109047.TB246109047.Text = DGV46109047.CurrentRow.Cells("namabarang").Value Latihan32C46109047.TB346109047.Text = DGV46109047.CurrentRow.Cells("hargajual").Value Latihan32C46109047.TB446109047.Text = DGV46109047.CurrentRow.Cells("jumlahbarang").Value End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click If Latihan32B46109047.Visible = False Then Latihan32B46109047.Show() Else Latihan32B46109047.Activate() End If End Sub End Class
Public Class LATIHAN32A46109026 Dim CONECT As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=26") Dim tinggal As New DataTable Private Sub LATIHAN32A46109026_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim pergi As New OleDb.OleDbDataAdapter pergi = New OleDb.OleDbDataAdapter("select * from barang", CONECT) pergi.Fill(tinggal) dtg46109026.DataSource = tinggal End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click If LATIHAN32C46109026.Visible = False Then LATIHAN32C46109026.Show() Else LATIHAN32C46109026.Activate() End If LATIHAN32C46109026.ToolStripStatusLabel1.Text = "kode barang lama= " & dtg46109026.CurrentRow.Cells("KodeBarang").Value LATIHAN32C46109026.kb46109026.Text = dtg46109026.CurrentRow.Cells("KodeBarang").Value LATIHAN32C46109026.nb46109026.Text = dtg46109026.CurrentRow.Cells("NamaBarang").Value LATIHAN32C46109026.hj46109026.Text = dtg46109026.CurrentRow.Cells("Hargajual").Value LATIHAN32C46109026.jb46109026.Text = dtg46109026.CurrentRow.Cells("jumlahbarang").Value End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If LATIHAN32B46109026.Visible = False Then LATIHAN32B46109026.Show() Else LATIHAN32B46109026.Activate() End If End Sub End Class
Public Class LATIHAN32B46109026 Dim CONECT As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=26")
Private Sub LATIHAN32B46109026_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If Val(kb46109026.Text) = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If
If nb46109026.Text.Length = 0 Then MsgBox("nama barang belum terisi") Exit Sub End If
If Val(hj46109026.Text) = 0 Then MsgBox("harga jual belum diisi") Exit Sub End If
If Val(jb46109026.Text) = 0 Then MsgBox("jumlah barang belum diisi") Exit Sub End If Dim tinggal As New OleDb.OleDbCommand tinggal = New OleDb.OleDbCommand("PsTambahBarang", CONECT) tinggal.CommandType = CommandType.StoredProcedure tinggal.Parameters.Add(New OleDb.OleDbParameter("pKodeBarang", kb46109026.Text)) tinggal.Parameters.Add(New OleDb.OleDbParameter("pNamaBarang", nb46109026.Text)) tinggal.Parameters.Add(New OleDb.OleDbParameter("pPersawal", Val(hj46109026.Text))) tinggal.Parameters.Add(New OleDb.OleDbParameter("pHargajual", Val(jb46109026.Text))) CONECT.Open() tinggal.ExecuteNonQuery() CONECT.Close() tinggal.Dispose()
kb46109026.Text = "" nb46109026.Text = "" hj46109026.Text = "" jb46109026.Text = "" End Sub End Class
Public Class LATIHAN32C46109026 Dim CONECT As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=26")
Private Sub LATIHAN32C46109026_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If Val(kb46109026.Text) = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If
If nb46109026.Text.Length = 0 Then MsgBox("nama barang belum terisi") Exit Sub End If
If Val(hj46109026.Text) = 0 Then MsgBox("harga jual belum diisi") Exit Sub End If
If Val(jb46109026.Text) = 0 Then MsgBox("jumlah barang belum diisi") Exit Sub End If Dim xx As New OleDb.OleDbCommand xx = New OleDb.OleDbCommand("UPDATE BARANG SET kodebarang = '" & kb46109026.Text & "', namabarang = '" & nb46109026.Text & "', hargajual = " & Val(hj46109026.Text) & ", jumlahbarang = " & Val(jb46109026.Text) & " where kodebarang ='" & ToolStripStatusLabel1.Text & "'", CONECT)
Public Class Form32C Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=allah swt") Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If Val(vd1_052.Text) = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If
If vd2_052.Text.Length = 0 Then MsgBox("nama barang belum terisi") Exit Sub End If
If Val(vd3_052.Text) = 0 Then MsgBox("harga jual belum diisi") Exit Sub End If
If Val(vd4_052.Text) = 0 Then MsgBox("jumlah barang belum diisi") Exit Sub End If Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("UPDATE BARANG SET kodebarang = '" & vd1_052.Text & "', namabarang = '" & vd2_052.Text & "', hargajual = " & Val(vd3_052.Text) & ", jumlahbarang = " & Val(vd4_052.Text) & " where kodebarang ='" & ToolStripStatusLabel1.Text & "'", conect)
Public Class Latihan_32A_46109044 Dim dt As New DataTable Dim hma As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/Databarang.ACCDB")
Public Sub syahril() Dim a As New OleDb.OleDbDataAdapter a = New OleDb.OleDbDataAdapter("select * from barang", hma) dt.Rows.Clear() a.Fill(dt) a.Dispose() End Sub
Private Sub Latihan_32A_46109044_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load syahril() dgv46109044.DataSource = dt End Sub
Private Sub T46109044_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles T46109044.Click If latihan_32B_46109044.Visible = False Then latihan_32B_46109044.Show() Else latihan_32B_46109044.Activate() End If End Sub
Private Sub E46109044_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles E46109044.Click If latihan_32C_46109044.Visible = False Then latihan_32C_46109044.Show() Else latihan_32C_46109044.Activate() End If
Public Class latihan_32B_46109044 Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet oledb:database password=1234")
Private Sub S46109044_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles S46109044.Click If kode46109044.Text.Length = 0 Then MsgBox("kode barang belum terisi bos") Exit Sub End If If nama46109044.Text.Length = 0 Then MsgBox("nama barang belum terisi bos") Exit Sub End If If harga46109044.Text.Length = 0 Then MsgBox("harga jual belum terisi bos") Exit Sub End If If jumlah46109044.Text.Length = 0 Then MsgBox("jumlah barang belum terisi bos") Exit Sub End If Dim ambil As New OleDb.OleDbCommand ambil = New OleDb.OleDbCommand("pstambahbarang", conect) ambil.CommandType = CommandType.StoredProcedure ambil.Parameters.Add(New OleDb.OleDbParameter("pkodebarang", kode46109044.Text)) ambil.Parameters.Add(New OleDb.OleDbParameter("pnamabarang", nama46109044.Text)) ambil.Parameters.Add(New OleDb.OleDbParameter("phargajual", harga46109044.Text)) ambil.Parameters.Add(New OleDb.OleDbParameter("pjumlahbarang", jumlah46109044.Text)) conect.Open() ambil.ExecuteNonQuery() conect.Close() ambil.Dispose()
kode46109044.Text = "" nama46109044.Text = "" harga46109044.Text = "" jumlah46109044.Text = "" End Sub
Private Sub latihan032B_46109044_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
FARADILLAH AMALIA RIVAI
BalasHapusLATIHAN 32 C
Public Class LATIHAN032C_46109010
Dim rossi As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet oledb:database password=46")
Private Sub simpan46109010_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles simpan46109010.Click
If t146109010.Text.Length = 0 Then
MsgBox("Isi text yang kosong")
Exit Sub
End If
If t246109010.Text.Length = 0 Then
MsgBox("Isi text yang kosong")
Exit Sub
End If
If Val(t346109010.Text) = 0 Then
MsgBox("Isi text yang kosong")
Exit Sub
End If
If Val(t446109010.Text) = 0 Then
MsgBox("Isi text yang kosong")
Exit Sub
End If
Dim vr As New OleDb.OleDbCommand
vr = New OleDb.OleDbCommand("update barang set kodebarang = '" & t146109010.Text & "', namabarang = '" & t246109010.Text & "', hargajual = " & Val(t346109010.Text) & ", jumlahbarang = " & Val(t446109010.Text) & " where kodebarang = '" & ToolStripStatusLabel1.Text & "'", rossi)
rossi.Open()
vr.ExecuteNonQuery()
rossi.Close()
vr.Dispose()
t146109010.Text = ""
t246109010.Text = ""
t346109010.Text = ""
t446109010.Text = ""
End Sub
End Class
Public Class Latihan32A_46109050
BalasHapusDim risky As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; Data Source=" & Application.StartupPath & "\DATABARANG.accdb;jet oledb:database password=kiki")
Dim ambil As New DataTable
Private Sub Latihan_32A_022_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim mahira As New OleDb.OleDbDataAdapter
mahira = New OleDb.OleDbDataAdapter("SELECT * FROM BARANG", risky)
mahira.Fill(ambil)
DGV_46109050.DataSource = ambil
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If Latihan32C_46109050.Visible = False Then
Latihan32C_46109050.Show()
Else
Latihan32C_46109050.Activate()
End If
Latihan32C_46109050.ToolStripStatusLabel1.Text = "kode barang lama = " & DGV_46109050.CurrentRow.Cells("kodebarang").Value
Latihan32C_46109050.QQ1_46109050.Text = DGV_46109050.CurrentRow.Cells("kodebarang").Value
Latihan32C_46109050.QQ2_46109050.Text = DGV_46109050.CurrentRow.Cells("namabarang").Value
Latihan32C_46109050.QQ3_46109050.Text = DGV_46109050.CurrentRow.Cells("hargajual").Value
Latihan32C_46109050.QQ4_46109050.Text = DGV_46109050.CurrentRow.Cells("jumlahbarang").Value
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If Latihan32B_46109050.Visible = False Then
Latihan32B_46109050.Show()
Else
Latihan32B_46109050.Activate()
End If
End Sub
End Class
Public Class Latihan32B_46109050
BalasHapusDim risky As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; Data Source=" & Application.StartupPath & "\DATABARANG.accdb;jet oledb:database password=kiki")
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If Val(QQ1_46109050.Text) = 0 Then
MsgBox("Kode barang belum terisi")
Exit Sub
End If
If QQ2_46109050.Text.Length = 0 Then
MsgBox("Kode barang belum terisi")
Exit Sub
End If
If Val(QQ3_46109050.Text) = 0 Then
MsgBox("Kode barang belum terisi")
Exit Sub
End If
If Val(QQ4_46109050.Text) = 0 Then
MsgBox("Kode barang belum terisi")
Exit Sub
End If
Dim mahira As New OleDb.OleDbCommand
mahira = New OleDb.OleDbCommand("PsTambahBarang", risky)
mahira.CommandType = CommandType.StoredProcedure
mahira.Parameters.Add(New OleDb.OleDbParameter("pKodeBarang", QQ1_46109050.Text))
mahira.Parameters.Add(New OleDb.OleDbParameter("pNamaBarang", QQ2_46109050.Text))
mahira.Parameters.Add(New OleDb.OleDbParameter("pPersawal", QQ3_46109050.Text))
mahira.Parameters.Add(New OleDb.OleDbParameter("pHargaJual", QQ4_46109050.Text))
risky.Open()
mahira.ExecuteNonQuery()
risky.Close()
mahira.Dispose()
QQ1_46109050.Text = ""
QQ2_46109050.Text = ""
QQ3_46109050.Text = ""
QQ4_46109050.Text = ""
End Sub
End Class
Public Class Latihan32C_46109050
BalasHapusDim risky As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; Data Source=" & Application.StartupPath & "\DATABARANG.accdb;jet oledb:database password=kiki")
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If Val(QQ1_46109050.Text) = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If Val(QQ2_46109050.Text) = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If Val(QQ3_46109050.Text) = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If Val(QQ4_46109050.Text) = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
Dim mahira As New OleDb.OleDbCommand
mahira = New OleDb.OleDbCommand("UPDATE BARANG SET kodebarang = '" & QQ1_46109050.Text & "', namabarang = '" & QQ2_46109050.Text & "', hargajual = " & Val(QQ3_46109050.Text) & ", jumlahbarang = " & Val(QQ4_46109050.Text) & " where odebarang = '" & ToolStripStatusLabel1.Text & "'", risky)
risky.Open()
mahira.ExecuteNonQuery()
risky.Close()
mahira.Dispose()
QQ1_46109050.Text = ""
QQ2_46109050.Text = ""
QQ3_46109050.Text = ""
QQ4_46109050.Text = ""
End Sub
End Class
Public Class LATIHAN032B_46109006
BalasHapusDim sry As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet oledb:database password=10")
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If KB.Text.Length = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If NB.Text.Length = 0 Then
MsgBox("nama barang belum terisi")
Exit Sub
End If
If Val(HJ.Text) = 0 Then
MsgBox("harga jual belum terisi")
Exit Sub
End If
If Val(JB.Text) = 0 Then
MsgBox("jumlah barang belum terisi")
Exit Sub
End If
Dim ki2 As New OleDb.OleDbCommand
Ki2 = New OleDb.OleDbCommand("PsTAMBAHBARANG", sry)
ki2.CommandType = CommandType.StoredProcedure
ki2.Parameters.Add(New OleDb.OleDbParameter("pKODEBARANG", KB.Text))
ki2.Parameters.Add(New OleDb.OleDbParameter("pNAMABARANG", NB.Text))
ki2.Parameters.Add(New OleDb.OleDbParameter("pPERSEDIAANAWAL", Val(HJ.Text)))
ki2.Parameters.Add(New OleDb.OleDbParameter("pHARGAJUAL", Val(JB.Text)))
sry.Open()
ki2.ExecuteNonQuery()
sry.Close()
ki2.Dispose()
KB.Text = ""
NB.Text = ""
HJ.Text = ""
JB.Text = ""
End Sub
End Class
Public Class LATIHAN032C_46109006
BalasHapusDim SRY As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet oledb:database password=10")
Private Sub simpan46109006_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles simpan46109006.Click
If KB.Text.Length = 0 Then
MsgBox("Isi text yang kosong")
Exit Sub
End If
If NB.Text.Length = 0 Then
MsgBox("Isi text yang kosong")
Exit Sub
End If
If Val(HJ.Text) = 0 Then
MsgBox("Isi text yang kosong")
Exit Sub
End If
If Val(JB.Text) = 0 Then
MsgBox("Isi text yang kosong")
Exit Sub
End If
Dim KI2 As New OleDb.OleDbCommand
KI2 = New OleDb.OleDbCommand("update barang set kodebarang = '" & KB.Text & "', namabarang = '" & NB.Text & "', hargajual = " & Val(HJ.Text) & ", jumlahbarang = " & Val(JB.Text) & " where kodebarang = '" & ToolStripStatusLabel1.Text & "'", SRY)
SRY.Open()
KI2.ExecuteNonQuery()
SRY.Close()
KI2.Dispose()
KB.Text = ""
NB.Text = ""
HJ.Text = ""
JB.Text = ""
End Sub
End Class
Public Class Latihan32A46109047
BalasHapusDim itha As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:database password=979264")
Dim ambil As New DataTable
Private Sub Latihan32A46109047_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim muhitha As New OleDb.OleDbDataAdapter
muhitha = New OleDb.OleDbDataAdapter("SELECT * FROM BARANG", itha)
muhitha.Fill(ambil)
DGV46109047.DataSource = ambil
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If Latihan32C46109047.Visible = False Then
Latihan32C46109047.Show()
Else
Latihan32C46109047.Activate()
End If
Latihan32C46109047.ToolStripStatusLabel1.Text = "kode barang lama = " & DGV46109047.CurrentRow.Cells("kodebarang").Value
Latihan32C46109047.TB146109047.Text = DGV46109047.CurrentRow.Cells("kodebarang").Value
Latihan32C46109047.TB246109047.Text = DGV46109047.CurrentRow.Cells("namabarang").Value
Latihan32C46109047.TB346109047.Text = DGV46109047.CurrentRow.Cells("hargajual").Value
Latihan32C46109047.TB446109047.Text = DGV46109047.CurrentRow.Cells("jumlahbarang").Value
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If Latihan32B46109047.Visible = False Then
Latihan32B46109047.Show()
Else
Latihan32B46109047.Activate()
End If
End Sub
End Class
Public Class LATIHAN32A46109026
BalasHapusDim CONECT As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=26")
Dim tinggal As New DataTable
Private Sub LATIHAN32A46109026_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim pergi As New OleDb.OleDbDataAdapter
pergi = New OleDb.OleDbDataAdapter("select * from barang", CONECT)
pergi.Fill(tinggal)
dtg46109026.DataSource = tinggal
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If LATIHAN32C46109026.Visible = False Then
LATIHAN32C46109026.Show()
Else
LATIHAN32C46109026.Activate()
End If
LATIHAN32C46109026.ToolStripStatusLabel1.Text = "kode barang lama= " & dtg46109026.CurrentRow.Cells("KodeBarang").Value
LATIHAN32C46109026.kb46109026.Text = dtg46109026.CurrentRow.Cells("KodeBarang").Value
LATIHAN32C46109026.nb46109026.Text = dtg46109026.CurrentRow.Cells("NamaBarang").Value
LATIHAN32C46109026.hj46109026.Text = dtg46109026.CurrentRow.Cells("Hargajual").Value
LATIHAN32C46109026.jb46109026.Text = dtg46109026.CurrentRow.Cells("jumlahbarang").Value
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If LATIHAN32B46109026.Visible = False Then
LATIHAN32B46109026.Show()
Else
LATIHAN32B46109026.Activate()
End If
End Sub
End Class
Public Class LATIHAN32B46109026
BalasHapusDim CONECT As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=26")
Private Sub LATIHAN32B46109026_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If Val(kb46109026.Text) = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If nb46109026.Text.Length = 0 Then
MsgBox("nama barang belum terisi")
Exit Sub
End If
If Val(hj46109026.Text) = 0 Then
MsgBox("harga jual belum diisi")
Exit Sub
End If
If Val(jb46109026.Text) = 0 Then
MsgBox("jumlah barang belum diisi")
Exit Sub
End If
Dim tinggal As New OleDb.OleDbCommand
tinggal = New OleDb.OleDbCommand("PsTambahBarang", CONECT)
tinggal.CommandType = CommandType.StoredProcedure
tinggal.Parameters.Add(New OleDb.OleDbParameter("pKodeBarang", kb46109026.Text))
tinggal.Parameters.Add(New OleDb.OleDbParameter("pNamaBarang", nb46109026.Text))
tinggal.Parameters.Add(New OleDb.OleDbParameter("pPersawal", Val(hj46109026.Text)))
tinggal.Parameters.Add(New OleDb.OleDbParameter("pHargajual", Val(jb46109026.Text)))
CONECT.Open()
tinggal.ExecuteNonQuery()
CONECT.Close()
tinggal.Dispose()
kb46109026.Text = ""
nb46109026.Text = ""
hj46109026.Text = ""
jb46109026.Text = ""
End Sub
End Class
Public Class LATIHAN32C46109026
BalasHapusDim CONECT As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=26")
Private Sub LATIHAN32C46109026_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If Val(kb46109026.Text) = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If nb46109026.Text.Length = 0 Then
MsgBox("nama barang belum terisi")
Exit Sub
End If
If Val(hj46109026.Text) = 0 Then
MsgBox("harga jual belum diisi")
Exit Sub
End If
If Val(jb46109026.Text) = 0 Then
MsgBox("jumlah barang belum diisi")
Exit Sub
End If
Dim xx As New OleDb.OleDbCommand
xx = New OleDb.OleDbCommand("UPDATE BARANG SET kodebarang = '" & kb46109026.Text & "', namabarang = '" & nb46109026.Text & "', hargajual = " & Val(hj46109026.Text) & ", jumlahbarang = " & Val(jb46109026.Text) & " where kodebarang ='" & ToolStripStatusLabel1.Text & "'", CONECT)
CONECT.Open()
xx.ExecuteNonQuery()
CONECT.Close()
xx.Dispose()
kb46109026.Text = ""
nb46109026.Text = ""
hj46109026.Text = ""
jb46109026.Text = ""
End Sub
End Class
Public Class Form32C
BalasHapusDim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=allah swt")
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If Val(vd1_052.Text) = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If vd2_052.Text.Length = 0 Then
MsgBox("nama barang belum terisi")
Exit Sub
End If
If Val(vd3_052.Text) = 0 Then
MsgBox("harga jual belum diisi")
Exit Sub
End If
If Val(vd4_052.Text) = 0 Then
MsgBox("jumlah barang belum diisi")
Exit Sub
End If
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("UPDATE BARANG SET kodebarang = '" & vd1_052.Text & "', namabarang = '" & vd2_052.Text & "', hargajual = " & Val(vd3_052.Text) & ", jumlahbarang = " & Val(vd4_052.Text) & " where kodebarang ='" & ToolStripStatusLabel1.Text & "'", conect)
conect.Open()
com.ExecuteNonQuery()
conect.Close()
com.Dispose()
vd1_052.Text = ""
vd2_052.Text = ""
vd3_052.Text = ""
vd4_052.Text = ""
End Sub
End Class
http://kumpulanlatihan46109060.blogspot.com/2011/11/latihan-32.html
BalasHapushttp://taufiqgooners.blogspot.com/2011/11/latihan-32-apkom.html
BalasHapushttp://irvanbravely.blogspot.com/2011/11/latihan-32-apkom.html
BalasHapusPublic Class Latihan_32A_46109044
BalasHapusDim dt As New DataTable
Dim hma As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/Databarang.ACCDB")
Public Sub syahril()
Dim a As New OleDb.OleDbDataAdapter
a = New OleDb.OleDbDataAdapter("select * from barang", hma)
dt.Rows.Clear()
a.Fill(dt)
a.Dispose()
End Sub
Private Sub Latihan_32A_46109044_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
syahril()
dgv46109044.DataSource = dt
End Sub
Private Sub T46109044_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles T46109044.Click
If latihan_32B_46109044.Visible = False Then
latihan_32B_46109044.Show()
Else
latihan_32B_46109044.Activate()
End If
End Sub
Private Sub E46109044_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles E46109044.Click
If latihan_32C_46109044.Visible = False Then
latihan_32C_46109044.Show()
Else
latihan_32C_46109044.Activate()
End If
latihan_32C_46109044.kode46109044.Text = dgv46109044.CurrentRow.Cells("kodebarang").Value
latihan_32C_46109044.nama46109044.Text = dgv46109044.CurrentRow.Cells("namabarang").Value
latihan_32C_46109044.harga46109044.Text = dgv46109044.CurrentRow.Cells("hargajual").Value
latihan_32C_46109044.jumlah46109044.Text = dgv46109044.CurrentRow.Cells("jumlahbarang").Value
latihan_32C_46109044.kode246109002.Text = dgv46109044.CurrentRow.Cells("kodebarang").Value
latihan_32C_46109044.Show()
End Sub
End Class
Public Class latihan_32B_46109044
BalasHapusDim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet oledb:database password=1234")
Private Sub S46109044_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles S46109044.Click
If kode46109044.Text.Length = 0 Then
MsgBox("kode barang belum terisi bos")
Exit Sub
End If
If nama46109044.Text.Length = 0 Then
MsgBox("nama barang belum terisi bos")
Exit Sub
End If
If harga46109044.Text.Length = 0 Then
MsgBox("harga jual belum terisi bos")
Exit Sub
End If
If jumlah46109044.Text.Length = 0 Then
MsgBox("jumlah barang belum terisi bos")
Exit Sub
End If
Dim ambil As New OleDb.OleDbCommand
ambil = New OleDb.OleDbCommand("pstambahbarang", conect)
ambil.CommandType = CommandType.StoredProcedure
ambil.Parameters.Add(New OleDb.OleDbParameter("pkodebarang", kode46109044.Text))
ambil.Parameters.Add(New OleDb.OleDbParameter("pnamabarang", nama46109044.Text))
ambil.Parameters.Add(New OleDb.OleDbParameter("phargajual", harga46109044.Text))
ambil.Parameters.Add(New OleDb.OleDbParameter("pjumlahbarang", jumlah46109044.Text))
conect.Open()
ambil.ExecuteNonQuery()
conect.Close()
ambil.Dispose()
kode46109044.Text = ""
nama46109044.Text = ""
harga46109044.Text = ""
jumlah46109044.Text = ""
End Sub
Private Sub latihan032B_46109044_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class