Public Class Latihan28a_035 Dim go As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source =D:\materi kuliah II\semester 5\VB\LATIHAN 27-34 SIMPAN EDIT DELETE DATA\DATABARANG.accdb") Dim take As New DataTable Public Sub ambildata() 'mendeklarasikan adapter Dim data As New OleDb.OleDbDataAdapter
'mengatur data yang akan diangkut data = New OleDb.OleDbDataAdapter("SELECT* from BARANG", go)
'bersihkan data sebelum mengisi data lain take.Rows.Clear()
'memasukkan data yg telah diambil ke dalam data grid view data.Fill(take) data.Dispose() End Sub
Private Sub Latihan28a_035_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ambildata() DataGridView1035.DataSource = take End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 'menampilkan form latihan28b If Latihan28b_035.Visible = False Then Latihan28b_035.Show() Else Latihan28b_035.Activate() End If End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Me.Close() End Sub End Class
Public Class Latihan28b_035 Dim go As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source =D:\materi kuliah II\semester 5\VB\LATIHAN 27-34 SIMPAN EDIT DELETE DATA\DATABARANG.accdb")
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 'perintah periksa data If t1.Text.Length = 0 Then MsgBox("Please Insert Your Text") Exit Sub End If
If t2.Text.Length = 0 Then MsgBox("Please Insert Your Text") Exit Sub End If
If Val(t3.Text) = 0 Then MsgBox("Please Insert Your Text") Exit Sub End If
If Val(t4.Text) = 0 Then MsgBox("Please Insert Your Text") Exit Sub End If
'perintah ambil data Dim PENCARI As New ByIskandar.CariKeDataBaseByIskandar PENCARI.AturPencarianDataBase("BARANG", "KODEBARANG", t1.Text, 1, go)
If PENCARI.JumlanBaris > 0 Then MsgBox("The data has been exist please insert new data")
'mengosongkan text box t1.Text = " " t2.Text = " " t3.Text = " " t4.Text = " " Exit Sub End If
'deklarasi object command Dim Cm As New OleDb.OleDbCommand Cm = New OleDb.OleDbCommand("INSERT INTO BARANG (KODEBARANG, NAMABARANG, HARGAJUAL, JUMLAHBARANG) VALUES ('" & t1.Text & "','" & t2.Text & "', " & Val(t3.Text) & "," & Val(t4.Text) & ")", go) go.Open() Cm.ExecuteNonQuery() go.Close() Cm.Dispose()
Public Class Latihan28a_030 Dim go As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source =D:\materi kuliah II\semester 5\VB\LATIHAN 27-34 SIMPAN EDIT DELETE DATA\DATABARANG.accdb") Dim take As New DataTable Public Sub ambildata() 'mendeklarasikan adapter Dim data As New OleDb.OleDbDataAdapter
'mengatur data yang akan diangkut data = New OleDb.OleDbDataAdapter("SELECT* from BARANG", go)
'bersihkan data sebelum mengisi data lain take.Rows.Clear()
'memasukkan data yg telah diambil ke dalam data grid view data.Fill(take) data.Dispose() End Sub
Private Sub Latihan28a_030_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ambildata() DataGridView1030.DataSource = take End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 'menampilkan form latihan28b If Latihan28b_030.Visible = False Then Latihan28b_030.Show() Else Latihan28b_030.Activate() End If End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Me.Close() End Sub End Class
Public Class Latihan28b_030 Dim go As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source =D:\materi kuliah II\semester 5\VB\LATIHAN 27-34 SIMPAN EDIT DELETE DATA\DATABARANG.accdb")
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 'perintah periksa data If t1.Text.Length = 0 Then MsgBox("Please Insert Your Text") Exit Sub End If
If t2.Text.Length = 0 Then MsgBox("Please Insert Your Text") Exit Sub End If
If Val(t3.Text) = 0 Then MsgBox("Please Insert Your Text") Exit Sub End If
If Val(t4.Text) = 0 Then MsgBox("Please Insert Your Text") Exit Sub End If
'perintah ambil data Dim PENCARI As New ByIskandar.CariKeDataBaseByIskandar PENCARI.AturPencarianDataBase("BARANG", "KODEBARANG", t1.Text, 1, go)
If PENCARI.JumlanBaris > 0 Then MsgBox("The data has been exist please insert new data")
'mengosongkan text box t1.Text = " " t2.Text = " " t3.Text = " " t4.Text = " " Exit Sub End If
'deklarasi object command Dim Cm As New OleDb.OleDbCommand Cm = New OleDb.OleDbCommand("INSERT INTO BARANG (KODEBARANG, NAMABARANG, HARGAJUAL, JUMLAHBARANG) VALUES ('" & t1.Text & "','" & t2.Text & "', " & Val(t3.Text) & "," & Val(t4.Text) & ")", go) go.Open() Cm.ExecuteNonQuery() go.Close() Cm.Dispose()
Public Class Latihan28B36109040 Dim go As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source =D:\materi kuliah II\semester 5\VB\LATIHAN 27-34 SIMPAN EDIT DELETE DATA\DATABARANG.accdb") Dim take As New DataTable Public Sub ambildata() 'mendeklarasikan adapter Dim data As New OleDb.OleDbDataAdapter
'mengatur data yang akan diangkut data = New OleDb.OleDbDataAdapter("SELECT* from BARANG", go)
'bersihkan data sebelum mengisi data lain take.Rows.Clear()
'memasukkan data yg telah diambil ke dalam data grid view data.Fill(take) data.Dispose() End Sub
Private Sub Latihan28B36109040_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ambildata() DataGridView1040.DataSource = take End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 'menampilkan form latihan28B If Latihan28B36109040.Visible = False Then Latihan28B36109040.Show() Else Latihan28B36109040.Activate() End If End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Me.Close() End Sub End Class
Public Class LATIHAN_028A_36109056 Dim conect As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\databarang.accdb") Dim hasbiya As New DataTable Private Sub LATIHAN_028A_36109056_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim adapter As OleDb.OleDbDataAdapter adapter = New OleDb.OleDbDataAdapter("select*from BARANG", conect) adapter.Fill(hasbiya) DataGridView1.DataSource = hasbiya End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If LATIHAN_028B_36109056.Visible = False Then LATIHAN_028B_36109056.Show() Else LATIHAN_028B_36109056.Activate() End If End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click End End Sub End Class
Public Class LATIHAN_028B_36109056 Dim conect As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\databarang.accdb") Dim hasbiya As New DataTable Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim biya As New OleDb.OleDbDataAdapter("select count(*) as coba from barang where kodebarang ='" & Textbox1_36109056.Text & "'", conect) hasbiya.Rows.Clear() biya.Fill(hasbiya) If hasbiya.Rows(0).Item("coba") > 0 Then MsgBox("kode barang sudah ada") Else tingting() End If data() Textbox1_36109056.Text = "" Textbox2_36109056.Text = "" Textbox3_36109056.Text = "" Textbox4_36109056.Text = ""
End Sub Public Sub tingting() Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & Textbox1_36109056.Text & "','" & Textbox2_36109056.Text & "'," & Val(Textbox3_36109056.Text) & "," & Val(Textbox4_36109056.Text) & ")", conect)
End Sub Public Sub data() If Val(Textbox1_36109056.Text) = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If If Textbox2_36109056.Text.Length = 0 Then MsgBox("nama barang belum terisi") Exit Sub End If
If Val(Textbox3_36109056.Text) = 0 Then MsgBox("harga jual belum diisi") Exit Sub End If
If Val(Textbox4_36109056.Text) = 0 Then MsgBox("jumlah barang belum diisi") Exit Sub End If End Sub
Private Sub LATIHAN_028B_36109056_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim CONECT As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\DataBarang.accdb") Dim NUNU As New DataTable Dim adapter As OleDb.OleDbDataAdapter Private Sub Latih28A_36109034_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load adapter = New OleDb.OleDbDataAdapter("select * FROM BARANG", CONECT) adapter.Fill(NUNU) DataGridView1.DataSource = NUNU End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If Latih28B_36109034.Visible = False Then Latih28B_36109034.Show() Else Latih28B_36109034.Activate() End If End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click End End Sub End Class
Public Class Latih28B_36109034 Dim CONECT As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\databarang.accdb") Dim NURHIDAYAH As New DataTable
Private Sub SIMPAN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SIMPAN.Click Dim NUNU As New OleDb.OleDbDataAdapter("select count(*) as coba from barang where kodebarang ='" & t136109034.Text & "'", CONECT) NURHIDAYAH.Rows.Clear() NUNU.Fill(NURHIDAYAH) If NURHIDAYAH.Rows(0).Item("coba") > 0 Then MsgBox("kode barang sudah ada") Else YAYA() End If Data()
Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t136109034.Text & "','" & t236109034.Text & "'," & Val(t336109034.Text) & "," & Val(t436109034.Text) & ")", CONECT)
Public Sub data() If Val(t136109034.Text) = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If If t236109034.Text.Length = 0 Then MsgBox("nama barang belum terisi") Exit Sub End If
If Val(t336109034.Text) = 0 Then MsgBox("harga jual belum diisi") Exit Sub End If
If Val(t436109034.Text) = 0 Then MsgBox("jumlah barang belum diisi") Exit Sub End If End Sub End Class
Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=D:\berbagi\sharing2\LATIHAN 27-34 SIMPAN EDIT DELETE DATA\DATABARANG.accdb") Dim wawan As New DataTable
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim da As New OleDb.OleDbDataAdapter("select count(*) As cuang from barang where kodebarang = '" & t136109054.Text & "'", conect) wawan.Rows.Clear() da.Fill(wawan)
If wawan.Rows(0).Item("cuang") > 0 Then MsgBox("afwan kode tersebut telah ada") Else sukmawan() End If
mawan() End Sub
Public Sub sukmawan() Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t136109054.Text & "','" & t236109054.Text & "'," & Val(t336109054.Text) & "," & Val(t436109054.Text) & ")", conect)
End Sub Public Sub mawan() If t136109054.Text.Length = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If
If t236109054.Text.Length = 0 Then MsgBox("nama barang belum terisi") Exit Sub End If
If Val(t336109054.Text) = 0 Then MsgBox("harga jual belum diisi") Exit Sub End If
If Val(t436109054.Text) = 0 Then MsgBox("jumlah barang belum diisi") Exit Sub End If t136109054.Text = "" t236109054.Text = "" t336109054.Text = "" t436109054.Text = "" End Sub End Class
Public Class LATIHAN028A36109033 Dim CONECT As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\databarang.accdb") Dim tiwi As New DataTable Dim baris As DataRow Private Sub LATIHAN028A36109033_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim cobajaa As New OleDb.OleDbDataAdapter cobajaa = New OleDb.OleDbDataAdapter("select * from barang", CONECT) cobajaa.Fill(tiwi) DataGridView1.DataSource = tiwi End Sub
Private Sub Button136109033_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109033.Click If LATIHAN028B36109033.Visible = False Then LATIHAN028B36109033.Show() Else LATIHAN028B36109033.Activate() End If End Sub
Private Sub Button236109033_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button236109033.Click End End Sub
End Class
Public Class LATIHAN028B36109033 Dim CONECT As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\databarang.accdb") Dim dt As New DataTable
Private Sub Button136109033_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109033.Click Dim tiwi As New OleDb.OleDbDataAdapter("select count(*) as coba from barang where kodebarang ='" & t136109033.Text & "'", CONECT) dt.Rows.Clear() tiwi.Fill(dt) If dt.Rows(0).Item("coba") > 0 Then MsgBox("kode barang sudah ada") Else pratiwi() End If Data() t136109033.Text = "" t236109033.Text = "" t336109033.Text = "" t436109033.Text = "" End Sub
Public Sub pratiwi() Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t136109033.Text & "','" & t236109033.Text & "'," & Val(t336109033.Text) & "," & Val(t436109033.Text) & ")", CONECT)
CONECT.Open() com.ExecuteNonQuery() CONECT.Close() com.Dispose() End Sub
Public Sub data() If Val(t136109033.Text) = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If If t236109033.Text.Length = 0 Then MsgBox("nama barang belum terisi") Exit Sub End If
If Val(t336109033.Text) = 0 Then MsgBox("harga jual belum diisi") Exit Sub End If
If Val(t436109033.Text) = 0 Then MsgBox("jumlah barang belum diisi") Exit Sub End If End Sub
Private Sub LATIHAN028B36109033_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Public Class LATIHAN028A36109033 Dim CONECT As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=tahir") Dim tiwi As New DataTable Dim baris As DataRow Private Sub LATIHAN028A36109033_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim cobajaa As New OleDb.OleDbDataAdapter cobajaa = New OleDb.OleDbDataAdapter("select * from barang", CONECT) cobajaa.Fill(tiwi) DataGridView1.DataSource = tiwi End Sub
Private Sub Button136109033_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109033.Click If LATIHAN028B36109033.Visible = False Then LATIHAN028B36109033.Show() Else LATIHAN028B36109033.Activate() End If End Sub
Private Sub Button236109033_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button236109033.Click End End Sub
Public Class LATIHAN028B36109033 Dim CONECT As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=tahir") Dim dt As New DataTable
Private Sub Button136109033_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109033.Click Dim tiwi As New OleDb.OleDbDataAdapter("select count(*) as coba from barang where kodebarang ='" & t136109033.Text & "'", CONECT) dt.Rows.Clear() tiwi.Fill(dt) If dt.Rows(0).Item("coba") > 0 Then MsgBox("kode barang sudah ada") Else pratiwi() End If Data() t136109033.Text = "" t236109033.Text = "" t336109033.Text = "" t436109033.Text = "" End Sub
Public Sub pratiwi() Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t136109033.Text & "','" & t236109033.Text & "'," & Val(t336109033.Text) & "," & Val(t436109033.Text) & ")", CONECT)
CONECT.Open() com.ExecuteNonQuery() CONECT.Close() com.Dispose() End Sub
Public Sub data() If Val(t136109033.Text) = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If If t236109033.Text.Length = 0 Then MsgBox("nama barang belum terisi") Exit Sub End If
If Val(t336109033.Text) = 0 Then MsgBox("harga jual belum diisi") Exit Sub End If
If Val(t436109033.Text) = 0 Then MsgBox("jumlah barang belum diisi") Exit Sub End If End Sub
Private Sub LATIHAN028B36109033_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim sambung As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=jayapura") Dim pusat As New DataTable Dim cabang As DataRow
Private Sub LATIHAN028A36109032_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim lanjutkan As New OleDb.OleDbDataAdapter lanjutkan = New OleDb.OleDbDataAdapter("select * from barang", sambung) lanjutkan.Fill(pusat) DataGridView136109032.DataSource = pusat End Sub
Private Sub Button136109032_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109032.Click If LATIHAN028B36109032.Visible = False Then LATIHAN028B36109032.Show() Else LATIHAN028B36109032.Activate() End If End Sub
Private Sub Button236109032_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button236109032.Click End End Sub End Class
Dim sambung As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=jayapura") Dim misal As New ByIskandar.CariKeDataBaseByIskandar
Private Sub Button136109032_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109032.Click If Val(T136109032.Text) = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If
If T236109032.Text.Length = 0 Then MsgBox("nama barang belum terisi") Exit Sub End If
If Val(T336109032.Text) = 0 Then MsgBox("harga jual belum diisi") Exit Sub End If
If Val(T436109032.Text) = 0 Then MsgBox("jumlah barang belum diisi") Exit Sub End If
If misal.JumlanBaris > 0 Then MsgBox("kode sudah ada") Exit Sub End If
Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & T136109032.Text & "','" & T236109032.Text & "'," & Val(T336109032.Text) & "," & Val(T436109032.Text) & ")", sambung)
Public Class Latih28A_36109034 Dim conect As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=nhunoe") Dim nhunoe As New DataTable Dim baris As DataRow
Private Sub Latihan1536109034_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim cobaji As New OleDb.OleDbDataAdapter cobaji = New OleDb.OleDbDataAdapter("select * FROM BARANG", conect) cobaji.Fill(nhunoe) DataGridView1.DataSource = nhunoe End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If Latih28B_36109034.Visible = False Then Latih28B_36109034.Show() Else Latih28B_36109034.Activate() End If End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click End End Sub End Class
Public Class Latih28B_36109034 Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=nhunoe") Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub SIMPAN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SIMPAN.Click If Val(t136109034.Text) = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If
If t236109034.Text.Length = 0 Then MsgBox("nama barang belum terisi") Exit Sub End If
If Val(t336109034.Text) = 0 Then MsgBox("harga jual belum diisi") Exit Sub End If
If Val(t436109034.Text) = 0 Then MsgBox("jumlah barang belum diisi") Exit Sub End If
If cari.JumlanBaris > 0 Then MsgBox("kode sudah ada") Exit Sub End If
Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t136109034.Text & "','" & t236109034.Text & "'," & Val(t336109034.Text) & "," & Val(t436109034.Text) & ")", conect)
Public Class LATIHAN028A36109038 Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb;Jet OLEDB:Database Password=icha") Dim dtab As New DataTable
Public Sub icha() Dim adap As New OleDb.OleDbDataAdapter adap = New OleDb.OleDbDataAdapter("select * from barang", conect) dtab.Rows.Clear() adap.Fill(dtab) adap.Dispose()
End Sub
Private Sub LATIHAN028A36109038_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
icha() DataGridView1.DataSource = dtab
End Sub
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click If Latihan028B36109038.Visible = False Then Latihan028B36109038.Show() Else Latihan028B36109038.Activate() End If
End Sub
Private Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click Me.Close()
End Sub End Class
Public Class LATIHAN028B36109038 Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb;Jet OLEDB:Database Password=icha") Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click If Val(t136109038.Text) = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If
If t236109038.Text.Length = 0 Then MsgBox("nama barang belum terisi") Exit Sub End If
If Val(t336109038.Text) = 0 Then MsgBox("harga jual belum diisi") Exit Sub End If
If Val(t436109038.Text) = 0 Then MsgBox("jumlah barang belum diisi") Exit Sub End If
If cari.JumlanBaris > 0 Then MsgBox("kode sudah ada") Exit Sub End If
Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("insert into barang (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t136109038.Text & "','" & t236109038.Text & "'," & Val(t336109038.Text) & "," & Val(t436109038.Text) & ")", conect)
Public Class Lat28A36109042 Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb") Dim adapter As OleDb.OleDbDataAdapter Dim Muhammad As New DataTable
Private Sub LATIHAN028A012_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load adapter = New OleDb.OleDbDataAdapter("select * from barang", conect) adapter.Fill(Muhammad) DataGridView136109042.DataSource = Muhammad End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If Lat28B36109042.Visible = False Then Lat28B36109042.Show() Else Lat28B36109042.Activate() End If End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click End
Public Class Lat28B36109042 Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb") Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109042.Click
If Val(T136109042.Text) = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If
If T236109042.Text.Length = 0 Then MsgBox("nama barang belum terisi") Exit Sub End If
If Val(T336109042.Text) = 0 Then MsgBox("harga jual belum diisi") Exit Sub End If
If Val(T436109042.Text) = 0 Then MsgBox("jumlah barang belum diisi") Exit Sub End If
If cari.JumlanBaris > 0 Then MsgBox("kode sudah ada") Exit Sub End If
Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & T136109042.Text & "','" & T236109042.Text & "'," & Val(T336109042.Text) & "," & Val(T436109042.Text) & ")", conect)
Public Class LATIHAN028B36109048 Dim connect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=idunk") Dim tries As New ByIskandar.CariKeDataBaseByIskandar Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If Val(t1.Text) = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If
If t2.Text.Length = 0 Then MsgBox("nama barang belum terisi") Exit Sub End If
If Val(t3.Text) = 0 Then MsgBox("harga jual belum diisi") Exit Sub End If
If Val(t4.Text) = 0 Then MsgBox("jumlah barang belum diisi") Exit Sub End If
If tries.JumlanBaris > 0 Then MsgBox("kode sudah ada") Exit Sub End If
Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t1.Text & "','" & t2.Text & "'," & Val(t3.Text) & "," & Val(t4.Text) & ")", connect)
Public Class LATIHAN028B36109048 Dim connect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=idunk") Dim tries As New ByIskandar.CariKeDataBaseByIskandar Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If Val(t1.Text) = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If
If t2.Text.Length = 0 Then MsgBox("nama barang belum terisi") Exit Sub End If
If Val(t3.Text) = 0 Then MsgBox("harga jual belum diisi") Exit Sub End If
If Val(t4.Text) = 0 Then MsgBox("jumlah barang belum diisi") Exit Sub End If
If tries.JumlanBaris > 0 Then MsgBox("kode sudah ada") Exit Sub End If
Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t1.Text & "','" & t2.Text & "'," & Val(t3.Text) & "," & Val(t4.Text) & ")", connect)
Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=magfirah") Dim firah As New DataTable Dim baris As DataRow
Private Sub LATIHAN28A36109044_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim mula As New OleDb.OleDbDataAdapter mula = New OleDb.OleDbDataAdapter("select * from barang", conect) mula.Fill(firah) DataGridView1.DataSource = firah
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If LATIHAN28B36109044.Visible = False Then LATIHAN28B36109044.Show() Else LATIHAN28B36109044.Activate() End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click End End Sub End Class
Public Class LATIHAN28B36109044
Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=magfirah") Dim firah As New ByIskandar.CariKeDataBaseByIskandar
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If Val(t136109044.Text) = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If
If t236109044.Text.Length = 0 Then MsgBox("nama barang belum terisi") Exit Sub End If
If Val(t336109044.Text) = 0 Then MsgBox("harga jual belum diisi") Exit Sub End If
If Val(t436109044.Text) = 0 Then MsgBox("jumlah barang belum diisi") Exit Sub End If
If firah.JumlanBaris > 0 Then MsgBox("kode sudah ada") Exit Sub End If
Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t136109044.Text & "','" & t236109044.Text & "'," & Val(t336109044.Text) & "," & Val(t436109044.Text) & ")", conect)
Public Class Latihan28A36109046 Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb;Jet OLEDB:Database Password=14322836") Dim cari As New DataTable Public Sub ambildata() Dim data As New OleDb.OleDbDataAdapter data = New OleDb.OleDbDataAdapter("SELECT* from BARANG", conect) cari.Rows.Clear() data.Fill(cari) data.Dispose() End Sub
Private Sub Form28A36109046_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ambildata() DataGridView136109046.DataSource = cari End Sub
Private Sub Button136109046_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109046.Click If Latihan28B36109046.Visible = False Then Latihan28B36109046.Show() Else Latihan28B36109046.Activate() End If End Sub
Private Sub Button236109046_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button236109046.Click Me.Close() End Sub End Class
Public Class Latihan28B36109046 Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb;Jet OLEDB:Database Password=14322836")
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109046.Click If t136109046.Text.Length = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If
If t236109046.Text.Length = 0 Then MsgBox("nama barang belum terisi") Exit Sub End If
If Val(t336109046.Text) = 0 Then MsgBox("harga barang belum terisi") Exit Sub End If
If Val(t436109046.Text) = 0 Then MsgBox("jumlah barang belum terisi") Exit Sub End If
Dim CARI As New ByIskandar.CariKeDataBaseByIskandar CARI.AturPencarianDataBase("BARANG", "KODEBARANG", t136109046.Text, 1, conect)
If CARI.JumlanBaris > 0 Then MsgBox("kode sudah ada")
t136109046.Text = " " t236109046.Text = " " t336109046.Text = " " t436109046.Text = " " Exit Sub End If
Dim Cm As New OleDb.OleDbCommand Cm = New OleDb.OleDbCommand("INSERT INTO BARANG (KODEBARANG, NAMABARANG, HARGAJUAL, JUMLAHBARANG) VALUES ('" & t136109046.Text & "','" & t236109046.Text & "', " & Val(t336109046.Text) & "," & Val(t436109046.Text) & ")", conect) conect.Open() Cm.ExecuteNonQuery() conect.Close() Cm.Dispose()
Dim connect As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\DATABARANG.accdb") Dim falah As New DataTable Private Sub Latihan_1536109055_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim cobaji As New OleDb.OleDbDataAdapter cobaji = New OleDb.OleDbDataAdapter("select * from BARANG", connect) cobaji.Fill(falah) Dgv1.DataSource = falah End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If Latihan_28B36109055.Visible = False Then Latihan_28B36109055.Show() Else Latihan_28B36109055.Activate() End If End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click End End Sub End Class
Public Class Latihan_28B36109055
Dim connect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=25") Dim cari As New ByIskandar.CariKeDataBaseByIskandar Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If Val(t136109055.Text) = 0 Then MsgBox("kode barang belum terisi") Exit Sub End If
If t236109055.Text.Length = 0 Then MsgBox("nama barang belum terisi") Exit Sub End If
If Val(t336109055.Text) = 0 Then MsgBox("harga jual belum diisi") Exit Sub End If
If Val(t436109055.Text) = 0 Then MsgBox("jumlah barang belum diisi") Exit Sub End If
If cari.JumlanBaris > 0 Then MsgBox("kode sudah ada") Exit Sub End If
Dim com As New OleDb.OleDbCommand com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t136109055.Text & "','" & t236109055.Text & "'," & Val(t336109055.Text) & "," & Val(t436109055.Text) & ")", connect)
Public Class Latihan28a_035
BalasHapusDim go As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source =D:\materi kuliah II\semester 5\VB\LATIHAN 27-34 SIMPAN EDIT DELETE DATA\DATABARANG.accdb")
Dim take As New DataTable
Public Sub ambildata()
'mendeklarasikan adapter
Dim data As New OleDb.OleDbDataAdapter
'mengatur data yang akan diangkut
data = New OleDb.OleDbDataAdapter("SELECT* from BARANG", go)
'bersihkan data sebelum mengisi data lain
take.Rows.Clear()
'memasukkan data yg telah diambil ke dalam data grid view
data.Fill(take)
data.Dispose()
End Sub
Private Sub Latihan28a_035_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ambildata()
DataGridView1035.DataSource = take
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'menampilkan form latihan28b
If Latihan28b_035.Visible = False Then
Latihan28b_035.Show()
Else
Latihan28b_035.Activate()
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Me.Close()
End Sub
End Class
Public Class Latihan28b_035
BalasHapusDim go As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source =D:\materi kuliah II\semester 5\VB\LATIHAN 27-34 SIMPAN EDIT DELETE DATA\DATABARANG.accdb")
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'perintah periksa data
If t1.Text.Length = 0 Then
MsgBox("Please Insert Your Text")
Exit Sub
End If
If t2.Text.Length = 0 Then
MsgBox("Please Insert Your Text")
Exit Sub
End If
If Val(t3.Text) = 0 Then
MsgBox("Please Insert Your Text")
Exit Sub
End If
If Val(t4.Text) = 0 Then
MsgBox("Please Insert Your Text")
Exit Sub
End If
'perintah ambil data
Dim PENCARI As New ByIskandar.CariKeDataBaseByIskandar
PENCARI.AturPencarianDataBase("BARANG", "KODEBARANG", t1.Text, 1, go)
If PENCARI.JumlanBaris > 0 Then
MsgBox("The data has been exist please insert new data")
'mengosongkan text box
t1.Text = " "
t2.Text = " "
t3.Text = " "
t4.Text = " "
Exit Sub
End If
'deklarasi object command
Dim Cm As New OleDb.OleDbCommand
Cm = New OleDb.OleDbCommand("INSERT INTO BARANG (KODEBARANG, NAMABARANG, HARGAJUAL, JUMLAHBARANG) VALUES ('" & t1.Text & "','" & t2.Text & "', " & Val(t3.Text) & "," & Val(t4.Text) & ")", go)
go.Open()
Cm.ExecuteNonQuery()
go.Close()
Cm.Dispose()
'mengosongkan text box
t1.Text = " "
t2.Text = " "
t3.Text = " "
t4.Text = " "
'menjalankan procedure pengambilan data
Latihan28a_035.ambildata()
'menutup form
Me.Close()
End Sub
End Class
Public Class Latihan28a_030
BalasHapusDim go As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source =D:\materi kuliah II\semester 5\VB\LATIHAN 27-34 SIMPAN EDIT DELETE DATA\DATABARANG.accdb")
Dim take As New DataTable
Public Sub ambildata()
'mendeklarasikan adapter
Dim data As New OleDb.OleDbDataAdapter
'mengatur data yang akan diangkut
data = New OleDb.OleDbDataAdapter("SELECT* from BARANG", go)
'bersihkan data sebelum mengisi data lain
take.Rows.Clear()
'memasukkan data yg telah diambil ke dalam data grid view
data.Fill(take)
data.Dispose()
End Sub
Private Sub Latihan28a_030_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ambildata()
DataGridView1030.DataSource = take
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'menampilkan form latihan28b
If Latihan28b_030.Visible = False Then
Latihan28b_030.Show()
Else
Latihan28b_030.Activate()
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Me.Close()
End Sub
End Class
Public Class Latihan28b_030
BalasHapusDim go As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source =D:\materi kuliah II\semester 5\VB\LATIHAN 27-34 SIMPAN EDIT DELETE DATA\DATABARANG.accdb")
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'perintah periksa data
If t1.Text.Length = 0 Then
MsgBox("Please Insert Your Text")
Exit Sub
End If
If t2.Text.Length = 0 Then
MsgBox("Please Insert Your Text")
Exit Sub
End If
If Val(t3.Text) = 0 Then
MsgBox("Please Insert Your Text")
Exit Sub
End If
If Val(t4.Text) = 0 Then
MsgBox("Please Insert Your Text")
Exit Sub
End If
'perintah ambil data
Dim PENCARI As New ByIskandar.CariKeDataBaseByIskandar
PENCARI.AturPencarianDataBase("BARANG", "KODEBARANG", t1.Text, 1, go)
If PENCARI.JumlanBaris > 0 Then
MsgBox("The data has been exist please insert new data")
'mengosongkan text box
t1.Text = " "
t2.Text = " "
t3.Text = " "
t4.Text = " "
Exit Sub
End If
'deklarasi object command
Dim Cm As New OleDb.OleDbCommand
Cm = New OleDb.OleDbCommand("INSERT INTO BARANG (KODEBARANG, NAMABARANG, HARGAJUAL, JUMLAHBARANG) VALUES ('" & t1.Text & "','" & t2.Text & "', " & Val(t3.Text) & "," & Val(t4.Text) & ")", go)
go.Open()
Cm.ExecuteNonQuery()
go.Close()
Cm.Dispose()
'mengosongkan text box
t1.Text = " "
t2.Text = " "
t3.Text = " "
t4.Text = " "
'menjalankan procedure pengambilan data
Latihan28a_030.ambildata()
'menutup form
Me.Close()
End Sub
End Class
Public Class Latihan28B36109040
BalasHapusDim go As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source =D:\materi kuliah II\semester 5\VB\LATIHAN 27-34 SIMPAN EDIT DELETE DATA\DATABARANG.accdb")
Dim take As New DataTable
Public Sub ambildata()
'mendeklarasikan adapter
Dim data As New OleDb.OleDbDataAdapter
'mengatur data yang akan diangkut
data = New OleDb.OleDbDataAdapter("SELECT* from BARANG", go)
'bersihkan data sebelum mengisi data lain
take.Rows.Clear()
'memasukkan data yg telah diambil ke dalam data grid view
data.Fill(take)
data.Dispose()
End Sub
Private Sub Latihan28B36109040_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ambildata()
DataGridView1040.DataSource = take
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'menampilkan form latihan28B
If Latihan28B36109040.Visible = False Then
Latihan28B36109040.Show()
Else
Latihan28B36109040.Activate()
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Me.Close()
End Sub
End Class
Public Class LATIHAN_028A_36109056
BalasHapusDim conect As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\databarang.accdb")
Dim hasbiya As New DataTable
Private Sub LATIHAN_028A_36109056_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim adapter As OleDb.OleDbDataAdapter
adapter = New OleDb.OleDbDataAdapter("select*from BARANG", conect)
adapter.Fill(hasbiya)
DataGridView1.DataSource = hasbiya
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If LATIHAN_028B_36109056.Visible = False Then
LATIHAN_028B_36109056.Show()
Else
LATIHAN_028B_36109056.Activate()
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
End
End Sub
End Class
Public Class LATIHAN_028B_36109056
Dim conect As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\databarang.accdb")
Dim hasbiya As New DataTable
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim biya As New OleDb.OleDbDataAdapter("select count(*) as coba from barang where kodebarang ='" & Textbox1_36109056.Text & "'", conect)
hasbiya.Rows.Clear()
biya.Fill(hasbiya)
If hasbiya.Rows(0).Item("coba") > 0 Then
MsgBox("kode barang sudah ada")
Else
tingting()
End If
data()
Textbox1_36109056.Text = ""
Textbox2_36109056.Text = ""
Textbox3_36109056.Text = ""
Textbox4_36109056.Text = ""
End Sub
Public Sub tingting()
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & Textbox1_36109056.Text & "','" & Textbox2_36109056.Text & "'," & Val(Textbox3_36109056.Text) & "," & Val(Textbox4_36109056.Text) & ")", conect)
conect.Open()
com.ExecuteNonQuery()
conect.Close()
com.Dispose()
End Sub
Public Sub data()
If Val(Textbox1_36109056.Text) = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If Textbox2_36109056.Text.Length = 0 Then
MsgBox("nama barang belum terisi")
Exit Sub
End If
If Val(Textbox3_36109056.Text) = 0 Then
MsgBox("harga jual belum diisi")
Exit Sub
End If
If Val(Textbox4_36109056.Text) = 0 Then
MsgBox("jumlah barang belum diisi")
Exit Sub
End If
End Sub
Private Sub LATIHAN_028B_36109056_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class
Public Class Latih28A_36109034
BalasHapusDim CONECT As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\DataBarang.accdb")
Dim NUNU As New DataTable
Dim adapter As OleDb.OleDbDataAdapter
Private Sub Latih28A_36109034_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
adapter = New OleDb.OleDbDataAdapter("select * FROM BARANG", CONECT)
adapter.Fill(NUNU)
DataGridView1.DataSource = NUNU
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If Latih28B_36109034.Visible = False Then
Latih28B_36109034.Show()
Else
Latih28B_36109034.Activate()
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
End
End Sub
End Class
Public Class Latih28B_36109034
Dim CONECT As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\databarang.accdb")
Dim NURHIDAYAH As New DataTable
Private Sub SIMPAN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SIMPAN.Click
Dim NUNU As New OleDb.OleDbDataAdapter("select count(*) as coba from barang where kodebarang ='" & t136109034.Text & "'", CONECT)
NURHIDAYAH.Rows.Clear()
NUNU.Fill(NURHIDAYAH)
If NURHIDAYAH.Rows(0).Item("coba") > 0 Then
MsgBox("kode barang sudah ada")
Else
YAYA()
End If
Data()
t136109034.Text = ""
t236109034.Text = ""
t336109034.Text = ""
t436109034.Text = ""
End Sub
Public Sub YAYA()
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t136109034.Text & "','" & t236109034.Text & "'," & Val(t336109034.Text) & "," & Val(t436109034.Text) & ")", CONECT)
CONECT.Open()
com.ExecuteNonQuery()
CONECT.Close()
com.Dispose()
End Sub
Public Sub data()
If Val(t136109034.Text) = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If t236109034.Text.Length = 0 Then
MsgBox("nama barang belum terisi")
Exit Sub
End If
If Val(t336109034.Text) = 0 Then
MsgBox("harga jual belum diisi")
Exit Sub
End If
If Val(t436109034.Text) = 0 Then
MsgBox("jumlah barang belum diisi")
Exit Sub
End If
End Sub
End Class
Public Class LATIHAN028B36109054
BalasHapusDim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=D:\berbagi\sharing2\LATIHAN 27-34 SIMPAN EDIT DELETE DATA\DATABARANG.accdb")
Dim wawan As New DataTable
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim da As New OleDb.OleDbDataAdapter("select count(*) As cuang from barang where kodebarang = '" & t136109054.Text & "'", conect)
wawan.Rows.Clear()
da.Fill(wawan)
If wawan.Rows(0).Item("cuang") > 0 Then
MsgBox("afwan kode tersebut telah ada")
Else
sukmawan()
End If
mawan()
End Sub
Public Sub sukmawan()
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t136109054.Text & "','" & t236109054.Text & "'," & Val(t336109054.Text) & "," & Val(t436109054.Text) & ")", conect)
conect.Open()
com.ExecuteNonQuery()
conect.Close()
com.Dispose()
End Sub
Public Sub mawan()
If t136109054.Text.Length = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If t236109054.Text.Length = 0 Then
MsgBox("nama barang belum terisi")
Exit Sub
End If
If Val(t336109054.Text) = 0 Then
MsgBox("harga jual belum diisi")
Exit Sub
End If
If Val(t436109054.Text) = 0 Then
MsgBox("jumlah barang belum diisi")
Exit Sub
End If
t136109054.Text = ""
t236109054.Text = ""
t336109054.Text = ""
t436109054.Text = ""
End Sub
End Class
Public Class LATIHAN028A36109033
BalasHapusDim CONECT As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\databarang.accdb")
Dim tiwi As New DataTable
Dim baris As DataRow
Private Sub LATIHAN028A36109033_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim cobajaa As New OleDb.OleDbDataAdapter
cobajaa = New OleDb.OleDbDataAdapter("select * from barang", CONECT)
cobajaa.Fill(tiwi)
DataGridView1.DataSource = tiwi
End Sub
Private Sub Button136109033_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109033.Click
If LATIHAN028B36109033.Visible = False Then
LATIHAN028B36109033.Show()
Else
LATIHAN028B36109033.Activate()
End If
End Sub
Private Sub Button236109033_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button236109033.Click
End
End Sub
End Class
Public Class LATIHAN028B36109033
Dim CONECT As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\databarang.accdb")
Dim dt As New DataTable
Private Sub Button136109033_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109033.Click
Dim tiwi As New OleDb.OleDbDataAdapter("select count(*) as coba from barang where kodebarang ='" & t136109033.Text & "'", CONECT)
dt.Rows.Clear()
tiwi.Fill(dt)
If dt.Rows(0).Item("coba") > 0 Then
MsgBox("kode barang sudah ada")
Else
pratiwi()
End If
Data()
t136109033.Text = ""
t236109033.Text = ""
t336109033.Text = ""
t436109033.Text = ""
End Sub
Public Sub pratiwi()
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t136109033.Text & "','" & t236109033.Text & "'," & Val(t336109033.Text) & "," & Val(t436109033.Text) & ")", CONECT)
CONECT.Open()
com.ExecuteNonQuery()
CONECT.Close()
com.Dispose()
End Sub
Public Sub data()
If Val(t136109033.Text) = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If t236109033.Text.Length = 0 Then
MsgBox("nama barang belum terisi")
Exit Sub
End If
If Val(t336109033.Text) = 0 Then
MsgBox("harga jual belum diisi")
Exit Sub
End If
If Val(t436109033.Text) = 0 Then
MsgBox("jumlah barang belum diisi")
Exit Sub
End If
End Sub
Private Sub LATIHAN028B36109033_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class
revisi :)
BalasHapusPublic Class LATIHAN028A36109033
Dim CONECT As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=tahir")
Dim tiwi As New DataTable
Dim baris As DataRow
Private Sub LATIHAN028A36109033_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim cobajaa As New OleDb.OleDbDataAdapter
cobajaa = New OleDb.OleDbDataAdapter("select * from barang", CONECT)
cobajaa.Fill(tiwi)
DataGridView1.DataSource = tiwi
End Sub
Private Sub Button136109033_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109033.Click
If LATIHAN028B36109033.Visible = False Then
LATIHAN028B36109033.Show()
Else
LATIHAN028B36109033.Activate()
End If
End Sub
Private Sub Button236109033_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button236109033.Click
End
End Sub
End Class
revisi :)
BalasHapusPublic Class LATIHAN028B36109033
Dim CONECT As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=tahir")
Dim dt As New DataTable
Private Sub Button136109033_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109033.Click
Dim tiwi As New OleDb.OleDbDataAdapter("select count(*) as coba from barang where kodebarang ='" & t136109033.Text & "'", CONECT)
dt.Rows.Clear()
tiwi.Fill(dt)
If dt.Rows(0).Item("coba") > 0 Then
MsgBox("kode barang sudah ada")
Else
pratiwi()
End If
Data()
t136109033.Text = ""
t236109033.Text = ""
t336109033.Text = ""
t436109033.Text = ""
End Sub
Public Sub pratiwi()
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t136109033.Text & "','" & t236109033.Text & "'," & Val(t336109033.Text) & "," & Val(t436109033.Text) & ")", CONECT)
CONECT.Open()
com.ExecuteNonQuery()
CONECT.Close()
com.Dispose()
End Sub
Public Sub data()
If Val(t136109033.Text) = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If t236109033.Text.Length = 0 Then
MsgBox("nama barang belum terisi")
Exit Sub
End If
If Val(t336109033.Text) = 0 Then
MsgBox("harga jual belum diisi")
Exit Sub
End If
If Val(t436109033.Text) = 0 Then
MsgBox("jumlah barang belum diisi")
Exit Sub
End If
End Sub
Private Sub LATIHAN028B36109033_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class
Komentar ini telah dihapus oleh pengarang.
BalasHapusKomentar ini telah dihapus oleh pengarang.
BalasHapusPublic Class LATIHAN028A36109032
BalasHapusDim sambung As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=jayapura")
Dim pusat As New DataTable
Dim cabang As DataRow
Private Sub LATIHAN028A36109032_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim lanjutkan As New OleDb.OleDbDataAdapter
lanjutkan = New OleDb.OleDbDataAdapter("select * from barang", sambung)
lanjutkan.Fill(pusat)
DataGridView136109032.DataSource = pusat
End Sub
Private Sub Button136109032_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109032.Click
If LATIHAN028B36109032.Visible = False Then
LATIHAN028B36109032.Show()
Else
LATIHAN028B36109032.Activate()
End If
End Sub
Private Sub Button236109032_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button236109032.Click
End
End Sub
End Class
Public Class LATIHAN028B36109032
BalasHapusDim sambung As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=jayapura")
Dim misal As New ByIskandar.CariKeDataBaseByIskandar
Private Sub Button136109032_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109032.Click
If Val(T136109032.Text) = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If T236109032.Text.Length = 0 Then
MsgBox("nama barang belum terisi")
Exit Sub
End If
If Val(T336109032.Text) = 0 Then
MsgBox("harga jual belum diisi")
Exit Sub
End If
If Val(T436109032.Text) = 0 Then
MsgBox("jumlah barang belum diisi")
Exit Sub
End If
misal.AturPencarianDataBase("BARANG", "KODEBARANG", T136109032.Text, 1, sambung)
If misal.JumlanBaris > 0 Then
MsgBox("kode sudah ada")
Exit Sub
End If
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & T136109032.Text & "','" & T236109032.Text & "'," & Val(T336109032.Text) & "," & Val(T436109032.Text) & ")", sambung)
sambung.Open()
com.ExecuteNonQuery()
sambung.Close()
com.Dispose()
T136109032.Text = ""
T236109032.Text = ""
T336109032.Text = ""
T436109032.Text = ""
End Sub
End Class
REVISI WITH PASSWORD
BalasHapusPublic Class Latih28A_36109034
Dim conect As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=nhunoe")
Dim nhunoe As New DataTable
Dim baris As DataRow
Private Sub Latihan1536109034_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim cobaji As New OleDb.OleDbDataAdapter
cobaji = New OleDb.OleDbDataAdapter("select * FROM BARANG", conect)
cobaji.Fill(nhunoe)
DataGridView1.DataSource = nhunoe
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If Latih28B_36109034.Visible = False Then
Latih28B_36109034.Show()
Else
Latih28B_36109034.Activate()
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
End
End Sub
End Class
Public Class Latih28B_36109034
Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=nhunoe")
Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub SIMPAN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SIMPAN.Click
If Val(t136109034.Text) = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If t236109034.Text.Length = 0 Then
MsgBox("nama barang belum terisi")
Exit Sub
End If
If Val(t336109034.Text) = 0 Then
MsgBox("harga jual belum diisi")
Exit Sub
End If
If Val(t436109034.Text) = 0 Then
MsgBox("jumlah barang belum diisi")
Exit Sub
End If
cari.AturPencarianDataBase("BARANG", "KODEBARANG", t136109034.Text, 1, conect)
If cari.JumlanBaris > 0 Then
MsgBox("kode sudah ada")
Exit Sub
End If
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t136109034.Text & "','" & t236109034.Text & "'," & Val(t336109034.Text) & "," & Val(t436109034.Text) & ")", conect)
conect.Open()
com.ExecuteNonQuery()
conect.Close()
com.Dispose()
t136109034.Text = ""
t236109034.Text = ""
t336109034.Text = ""
t436109034.Text = ""
End Sub
End Class
Public Class LATIHAN028A36109038
BalasHapusDim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb;Jet OLEDB:Database Password=icha")
Dim dtab As New DataTable
Public Sub icha()
Dim adap As New OleDb.OleDbDataAdapter
adap = New OleDb.OleDbDataAdapter("select * from barang", conect)
dtab.Rows.Clear()
adap.Fill(dtab)
adap.Dispose()
End Sub
Private Sub LATIHAN028A36109038_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
icha()
DataGridView1.DataSource = dtab
End Sub
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
If Latihan028B36109038.Visible = False Then
Latihan028B36109038.Show()
Else
Latihan028B36109038.Activate()
End If
End Sub
Private Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
Me.Close()
End Sub
End Class
Public Class LATIHAN028B36109038
Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb;Jet OLEDB:Database Password=icha")
Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
If Val(t136109038.Text) = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If t236109038.Text.Length = 0 Then
MsgBox("nama barang belum terisi")
Exit Sub
End If
If Val(t336109038.Text) = 0 Then
MsgBox("harga jual belum diisi")
Exit Sub
End If
If Val(t436109038.Text) = 0 Then
MsgBox("jumlah barang belum diisi")
Exit Sub
End If
cari.AturPencarianDataBase("barang", "kodebarang", t136109038.Text, 1, conect)
If cari.JumlanBaris > 0 Then
MsgBox("kode sudah ada")
Exit Sub
End If
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("insert into barang (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t136109038.Text & "','" & t236109038.Text & "'," & Val(t336109038.Text) & "," & Val(t436109038.Text) & ")", conect)
conect.Open()
com.ExecuteNonQuery()
conect.Close()
com.Dispose()
t136109038.Text = ""
t236109038.Text = ""
t336109038.Text = ""
t436109038.Text = ""
LATIHAN028A36109038.icha()
End Sub
End Class
Public Class Lat28A36109042
BalasHapusDim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb")
Dim adapter As OleDb.OleDbDataAdapter
Dim Muhammad As New DataTable
Private Sub LATIHAN028A012_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
adapter = New OleDb.OleDbDataAdapter("select * from barang", conect)
adapter.Fill(Muhammad)
DataGridView136109042.DataSource = Muhammad
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If Lat28B36109042.Visible = False Then
Lat28B36109042.Show()
Else
Lat28B36109042.Activate()
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
End
End Sub
End Class
Public Class Lat28B36109042
BalasHapusDim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb")
Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109042.Click
If Val(T136109042.Text) = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If T236109042.Text.Length = 0 Then
MsgBox("nama barang belum terisi")
Exit Sub
End If
If Val(T336109042.Text) = 0 Then
MsgBox("harga jual belum diisi")
Exit Sub
End If
If Val(T436109042.Text) = 0 Then
MsgBox("jumlah barang belum diisi")
Exit Sub
End If
cari.AturPencarianDataBase("BARANG", "KODEBARANG", T136109042.Text, 1, conect)
If cari.JumlanBaris > 0 Then
MsgBox("kode sudah ada")
Exit Sub
End If
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & T136109042.Text & "','" & T236109042.Text & "'," & Val(T336109042.Text) & "," & Val(T436109042.Text) & ")", conect)
conect.Open()
com.ExecuteNonQuery()
conect.Close()
com.Dispose()
T136109042.Text = ""
T236109042.Text = ""
T336109042.Text = ""
T436109042.Text = ""
End Sub
End Class
Public Class LATIHAN028B36109048
BalasHapusDim connect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=idunk")
Dim tries As New ByIskandar.CariKeDataBaseByIskandar
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If Val(t1.Text) = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If t2.Text.Length = 0 Then
MsgBox("nama barang belum terisi")
Exit Sub
End If
If Val(t3.Text) = 0 Then
MsgBox("harga jual belum diisi")
Exit Sub
End If
If Val(t4.Text) = 0 Then
MsgBox("jumlah barang belum diisi")
Exit Sub
End If
tries.AturPencarianDataBase("BARANG", "KODEBARANG", t1.Text, 1, connect)
If tries.JumlanBaris > 0 Then
MsgBox("kode sudah ada")
Exit Sub
End If
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t1.Text & "','" & t2.Text & "'," & Val(t3.Text) & "," & Val(t4.Text) & ")", connect)
connect.Open()
com.ExecuteNonQuery()
connect.Close()
com.Dispose()
t1.Text = ""
t2.Text = ""
t3.Text = ""
t4.Text = ""
End Sub
End Class
Public Class LATIHAN028B36109048
BalasHapusDim connect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=idunk")
Dim tries As New ByIskandar.CariKeDataBaseByIskandar
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If Val(t1.Text) = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If t2.Text.Length = 0 Then
MsgBox("nama barang belum terisi")
Exit Sub
End If
If Val(t3.Text) = 0 Then
MsgBox("harga jual belum diisi")
Exit Sub
End If
If Val(t4.Text) = 0 Then
MsgBox("jumlah barang belum diisi")
Exit Sub
End If
tries.AturPencarianDataBase("BARANG", "KODEBARANG", t1.Text, 1, connect)
If tries.JumlanBaris > 0 Then
MsgBox("kode sudah ada")
Exit Sub
End If
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t1.Text & "','" & t2.Text & "'," & Val(t3.Text) & "," & Val(t4.Text) & ")", connect)
connect.Open()
com.ExecuteNonQuery()
connect.Close()
com.Dispose()
t1.Text = ""
t2.Text = ""
t3.Text = ""
t4.Text = ""
End Sub
End Class
Public Class LATIHAN28A36109044
BalasHapusDim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=magfirah")
Dim firah As New DataTable
Dim baris As DataRow
Private Sub LATIHAN28A36109044_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim mula As New OleDb.OleDbDataAdapter
mula = New OleDb.OleDbDataAdapter("select * from barang", conect)
mula.Fill(firah)
DataGridView1.DataSource = firah
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If LATIHAN28B36109044.Visible = False Then
LATIHAN28B36109044.Show()
Else
LATIHAN28B36109044.Activate()
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
End
End Sub
End Class
Public Class LATIHAN28B36109044
Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=magfirah")
Dim firah As New ByIskandar.CariKeDataBaseByIskandar
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If Val(t136109044.Text) = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If t236109044.Text.Length = 0 Then
MsgBox("nama barang belum terisi")
Exit Sub
End If
If Val(t336109044.Text) = 0 Then
MsgBox("harga jual belum diisi")
Exit Sub
End If
If Val(t436109044.Text) = 0 Then
MsgBox("jumlah barang belum diisi")
Exit Sub
End If
firah.AturPencarianDataBase("BARANG", "KODEBARANG", t136109044.Text, 1, conect)
If firah.JumlanBaris > 0 Then
MsgBox("kode sudah ada")
Exit Sub
End If
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t136109044.Text & "','" & t236109044.Text & "'," & Val(t336109044.Text) & "," & Val(t436109044.Text) & ")", conect)
conect.Open()
com.ExecuteNonQuery()
conect.Close()
com.Dispose()
t136109044.Text = ""
t236109044.Text = ""
t336109044.Text = ""
t436109044.Text = ""
End Sub
End Class
Public Class Latihan28A36109046
BalasHapusDim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb;Jet OLEDB:Database Password=14322836")
Dim cari As New DataTable
Public Sub ambildata()
Dim data As New OleDb.OleDbDataAdapter
data = New OleDb.OleDbDataAdapter("SELECT* from BARANG", conect)
cari.Rows.Clear()
data.Fill(cari)
data.Dispose()
End Sub
Private Sub Form28A36109046_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ambildata()
DataGridView136109046.DataSource = cari
End Sub
Private Sub Button136109046_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109046.Click
If Latihan28B36109046.Visible = False Then
Latihan28B36109046.Show()
Else
Latihan28B36109046.Activate()
End If
End Sub
Private Sub Button236109046_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button236109046.Click
Me.Close()
End Sub
End Class
Public Class Latihan28B36109046
Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb;Jet OLEDB:Database Password=14322836")
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109046.Click
If t136109046.Text.Length = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If t236109046.Text.Length = 0 Then
MsgBox("nama barang belum terisi")
Exit Sub
End If
If Val(t336109046.Text) = 0 Then
MsgBox("harga barang belum terisi")
Exit Sub
End If
If Val(t436109046.Text) = 0 Then
MsgBox("jumlah barang belum terisi")
Exit Sub
End If
Dim CARI As New ByIskandar.CariKeDataBaseByIskandar
CARI.AturPencarianDataBase("BARANG", "KODEBARANG", t136109046.Text, 1, conect)
If CARI.JumlanBaris > 0 Then
MsgBox("kode sudah ada")
t136109046.Text = " "
t236109046.Text = " "
t336109046.Text = " "
t436109046.Text = " "
Exit Sub
End If
Dim Cm As New OleDb.OleDbCommand
Cm = New OleDb.OleDbCommand("INSERT INTO BARANG (KODEBARANG, NAMABARANG, HARGAJUAL, JUMLAHBARANG) VALUES ('" & t136109046.Text & "','" & t236109046.Text & "', " & Val(t336109046.Text) & "," & Val(t436109046.Text) & ")", conect)
conect.Open()
Cm.ExecuteNonQuery()
conect.Close()
Cm.Dispose()
t136109046.Text = " "
t236109046.Text = " "
t336109046.Text = " "
t436109046.Text = " "
Latihan28A36109046.ambildata()
Me.Close()
End Sub
End Class
Public Class latihan_28A36109055
BalasHapusDim connect As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\DATABARANG.accdb")
Dim falah As New DataTable
Private Sub Latihan_1536109055_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim cobaji As New OleDb.OleDbDataAdapter
cobaji = New OleDb.OleDbDataAdapter("select * from BARANG", connect)
cobaji.Fill(falah)
Dgv1.DataSource = falah
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If Latihan_28B36109055.Visible = False Then
Latihan_28B36109055.Show()
Else
Latihan_28B36109055.Activate()
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
End
End Sub
End Class
Public Class Latihan_28B36109055
Dim connect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=25")
Dim cari As New ByIskandar.CariKeDataBaseByIskandar
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If Val(t136109055.Text) = 0 Then
MsgBox("kode barang belum terisi")
Exit Sub
End If
If t236109055.Text.Length = 0 Then
MsgBox("nama barang belum terisi")
Exit Sub
End If
If Val(t336109055.Text) = 0 Then
MsgBox("harga jual belum diisi")
Exit Sub
End If
If Val(t436109055.Text) = 0 Then
MsgBox("jumlah barang belum diisi")
Exit Sub
End If
cari.AturPencarianDataBase("BARANG", "KODEBARANG", t136109055.Text, 1, connect)
If cari.JumlanBaris > 0 Then
MsgBox("kode sudah ada")
Exit Sub
End If
Dim com As New OleDb.OleDbCommand
com = New OleDb.OleDbCommand("insert into BARANG (kodebarang, namabarang, hargajual, jumlahbarang) values ('" & t136109055.Text & "','" & t236109055.Text & "'," & Val(t336109055.Text) & "," & Val(t436109055.Text) & ")", connect)
connect.Open()
com.ExecuteNonQuery()
connect.Close()
com.Dispose()
t136109055.Text = ""
t236109055.Text = ""
t336109055.Text = ""
t436109055.Text = ""
End Sub
Private Sub Latihan_28B36109055_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class
http://hilariusmariotonapa.blogspot.com/2012/10/prosedur-penyelesaian-latihan28a36110048.html
BalasHapushttp://hilariusmariotonapa.blogspot.com/2012/10/deskripsi-latihan28a36110048.html
http://hilariusmariotonapa.blogspot.com/2012/10/prosedur-penyelesaian-latihan28b36110048.html
http://hilariusmariotonapa.blogspot.com/2012/10/deskripsi-latihan28b36110048.html
http://www.masnurselayar.blogspot.com/2012/10/latihan-28a36110055.html
BalasHapushttp://www.masnurselayar.blogspot.com/2012/10/latihan-28b36110055.html
http://nurrahmahrasyid2.blogspot.com/2012/10/latihan28a36110042.html
BalasHapushttp://nurrahmahrasyid2.blogspot.com/2012/10/latihan28b36110042.html
http://nurhanalott.blogspot.com/2012/10/latihan28a36110029.html
BalasHapushttp://nurhanalott.blogspot.com/2012/10/latihan28b36110029.html
http://03melisa.blogspot.com/2012/10/latihan-28a-36110051-apkom-4-akuntansi.html
BalasHapushttp://03melisa.blogspot.com/2012/10/latihan-28b-36110051-apkom-4-akuntansi.html
http://ias-anakbola.blogspot.com/2012/10/latihan28a36110056.html
BalasHapushttp://ias-anakbola.blogspot.com/2012/10/latihan28b36110056.html
http://andiniwarakusuma.blogspot.com/2012/10/latihan28a36110034.html
BalasHapushttp://andiniwarakusuma.blogspot.com/2012/10/latihan28b36110034.html
http://ilhaazzahra.blogspot.com/2012/10/latihan28a36110033.html
BalasHapushttp://ilhaazzahra.blogspot.com/2012/10/latihan28b36110033.html
http://rizka-azisah.blogspot.com/2012/10/blog-post.html
BalasHapushttp://rizka-azisah.blogspot.com/2012/10/deskripsi-penyelesaian_5033.html
Komentar ini telah dihapus oleh pengarang.
BalasHapushttp://rahmisuryatama05.blogspot.com/2012/10/latihan28a36110040_13.html
BalasHapushttp://rahmisuryatama05.blogspot.com/2012/10/latihan28b36110040.html
http://audryasharii.blogspot.com/2012/10/latihan28a36110031_5205.html
BalasHapushttp://audryasharii.blogspot.com/2012/10/latihan28b36110031.html
http://benhilll.blogspot.com/2012/10/deskripsi-dan-prosedur_12.html
BalasHapushttp://benhilll.blogspot.com/2012/10/deskripsi-dan-prosedur_1743.html
http://rosyanausman.blogspot.com/2012/10/latihan28a36110036.html
BalasHapushttp://rosyanausman.blogspot.com/2012/10/latihan28b36110036.html
http://rainaagrippinaa.blogspot.com/2012/10/latihan28a36110032.html
BalasHapushttp://rainaagrippinaa.blogspot.com/2012/10/latihan28b36110032.html
http://sriayu-36110030.blogspot.com/2012/10/diskripsi-prosedur-latihan-28.html
BalasHapushttp://sriayu-36110030.blogspot.com/2012/10/diskripsi-prosedur-latihan-28a.html
http://dewiwahyuni91.blogspot.com/2012/10/latihan28a36110038_11.html
BalasHapushttp://dewiwahyuni91.blogspot.com/2012/10/latihan28b36110038_11.html
http://tiya-sri.blogspot.com/2012/10/latihan28a26110044-aplikasi-komputer-4_13.html
BalasHapushttp://tiya-sri.blogspot.com/2012/10/latihan28b36110044-aplikasi-komputer-4.html
http://reskypurwono.blogspot.com/2012/10/prosedur-penyelesaian-latihan28a36110037.html
BalasHapushttp://reskypurwono.blogspot.com/2012/10/prosedur-penyelesaian-latihan28b36110037.html
http://burhankhang58.blogspot.com/2012/10/latihan28a36110047.html
BalasHapushttp://burhankhang58.blogspot.com/2012/10/latihan28b36110047.html
http://eminaomi.blogspot.com/2012/10/latihan28a36110049.html
BalasHapushttp://eminaomi.blogspot.com/2012/10/latihan28b36110049.html
http://hasfiahzain.blogspot.com/2012/10/latihan28a36110052.html
BalasHapushttp://hasfiahzain.blogspot.com/2012/10/latihan28b36110052.html
http://zulkiflitryputra.blogspot.com/2012/10/latihan28a36110046.html
BalasHapushttp://zulkiflitryputra.blogspot.com/2012/10/latihan28b36110046.html
http://sukadriady.blogspot.com/2012/10/latihan28a36110043.html
BalasHapushttp://sukadriady.blogspot.com/2012/10/latihan28b36110043.html
http://ruslancullank1.blogspot.com/2012/10/deksripsilatihan28a36110054.html
BalasHapushttp://ruslancullank1.blogspot.com/2012/10/deskripsilatihan28b36110054.html