Jumat, 25 November 2011

APKOM 4 (Latihan 31-32)

Latihan 31A

Public Class Latihan31A_36109005
    Dim DT As New DataTable
    Dim HP As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/Databarang.ACCDB")
    Public Sub ISMI()
        Dim AD As New OleDb.OleDbDataAdapter
        AD = New OleDb.OleDbDataAdapter("select * from barang", HP)
        DT.Rows.Clear()
        AD.Fill(DT)
        AD.Dispose()
    End Sub
    Private Sub Latihan31A_36109005_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ISMI()
        DGV_36109005.DataSource = DT
    End Sub
    Private Sub EDIT_36109005_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles EDIT_36109005.Click
        If Latihan31B_36109005.Visible = False Then
            Latihan31B_36109005.Show()
        Else
            Latihan31B_36109005.Activate()
        End If

        Latihan31B_36109005.KB_36109005.Text = DGV_36109005.CurrentRow.Cells("kodebarang").Value
        Latihan31B_36109005.t1_36109005.Text = DGV_36109005.CurrentRow.Cells("kodebarang").Value
        Latihan31B_36109005.t2_36109005.Text = DGV_36109005.CurrentRow.Cells("namabarang").Value
        Latihan31B_36109005.t3_36109005.Text = DGV_36109005.CurrentRow.Cells("hargajual").Value
        Latihan31B_36109005.t4_36109005.Text = DGV_36109005.CurrentRow.Cells("jumlahbarang").Value

        Latihan31B_36109005.Show()
    End Sub
End Class

Latihan 31B

Public Class Latihan31B_36109005
    Dim ISMI As New ByIskandar.CariKeDataBaseByIskandar
    Dim CM As New OleDb.OleDbCommand
    Dim MISCOL As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/Databarang.ACCDB")
    Private Sub Simpan_36109005_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Simpan_36109005.Click
        If t1_36109005.Text.Length = 0 Then
            MsgBox("Masukkan teks")
            Exit Sub
        End If

        If t2_36109005.Text.Length = 0 Then
            MsgBox("Masukkan teks")
            Exit Sub
        End If

        If Val(t3_36109005.Text) = 0 Then
            MsgBox("Masukkan teks")
            Exit Sub
        End If

        If Val(t4_36109005.Text) = 0 Then
            MsgBox("Masukkan teks")
            Exit Sub
        End If

        If t1_36109005.Text <> KB_36109005.Text Then
            ISMI.AturPencarianDataBase("Barang", "KodeBarang", t1_36109005.Text, 1, MISCOL)
            If ISMI.JumlanBaris > 0 Then
                MsgBox("Kode Barang Sudah Ada")
                Exit Sub
            End If
        End If

        CM = New OleDb.OleDbCommand("update barang set kodebarang = '" & t1_36109005.Text & "', namabarang = '" & t2_36109005.Text & "', hargajual = " & Val(t3_36109005.Text) & ", jumlahbarang = " & Val(t4_36109005.Text) & " where kodebarang = '" & KB_36109005.Text & "'", MISCOL)

        MISCOL.Open()
        CM.ExecuteNonQuery()
        MISCOL.Close()
        CM.Dispose()

        t1_36109005.Text = ""
        t2_36109005.Text = ""
        t3_36109005.Text = ""
        t4_36109005.Text = ""
        KB_36109005.Text = "-"

        Latihan31A_36109005.ISMI()
    End Sub
End Class 
Latihan 32A

Public Class Latihan32A_36109005
    Dim DT As New DataTable
    Dim SS As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/Databarang.ACCDB")
    Public Sub ISMI()
        Dim AD As New OleDb.OleDbDataAdapter
        AD = New OleDb.OleDbDataAdapter("select * from barang", SS)
        DT.Rows.Clear()
        AD.Fill(DT)
        AD.Dispose()
    End Sub
    Private Sub Latihan32A_36109005_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ISMI()
        DGV_36109005.DataSource = DT
    End Sub
    Private Sub T_36109005_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles T_36109005.Click
        If Latihan32B_36109005.Visible = False Then
            Latihan32B_36109005.Show()
        Else
            Latihan32B_36109005.Activate()
        End If

    End Sub
    Private Sub E_36109005_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles E_36109005.Click
        If Latihan32C_36109005.Visible = False Then
            Latihan32C_36109005.Show()
        Else
            Latihan32C_36109005.Activate()
        End If

        Latihan32C_36109005.KB_36109005.Text = DGV_36109005.CurrentRow.Cells("kodebarang").Value
        Latihan32C_36109005.t1_36109005.Text = DGV_36109005.CurrentRow.Cells("kodebarang").Value
        Latihan32C_36109005.t2_36109005.Text = DGV_36109005.CurrentRow.Cells("namabarang").Value
        Latihan32C_36109005.t3_36109005.Text = DGV_36109005.CurrentRow.Cells("hargajual").Value
        Latihan32C_36109005.t4_36109005.Text = DGV_36109005.CurrentRow.Cells("jumlahbarang").Value

        Latihan32C_36109005.Show()
    End Sub
End Class

Latihan 32B

Public Class Latihan32B_36109005
    Dim IMMY As New ByIskandar.CariKeDataBaseByIskandar
    Dim KALI As New OleDb.OleDbCommand
    Dim BAGI As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source =" & Application.StartupPath & "\DataBarang.ACCDB")
    Private Sub Simpan_36109005_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Simpan_36109005.Click
        If t1_36109005.Text.Length = 0 Then
            MsgBox("Masukkan teks")
            Exit Sub
        End If

        If t2_36109005.Text.Length = 0 Then
            MsgBox("Masukkan teks")
            Exit Sub
        End If

        If Val(t3_36109005.Text) = 0 Then
            MsgBox("Masukkan Teks")
            Exit Sub
        End If

        If Val(t4_36109005.Text) = 0 Then
            MsgBox("Masukkan teks")
            Exit Sub
        End If

        Dim PENCARI As New ByIskandar.CariKeDataBaseByIskandar
        PENCARI.AturPencarianDataBase("BARANG", "KODEBARANG", t1_36109005.Text, 1, BAGI)

        If PENCARI.JumlanBaris > 0 Then
            MsgBox("Kode Barang Sudah Ada")

            t1_36109005.Text = " "
            t2_36109005.Text = " "
            t3_36109005.Text = " "
            t4_36109005.Text = " "
            Exit Sub
        End If

        Dim MI As New OleDb.OleDbCommand
        MI = New OleDb.OleDbCommand("INSERT INTO BARANG (KODEBARANG, NAMABARANG, HARGAJUAL, JUMLAHBARANG) VALUES ('" & t1_36109005.Text & "','" & t2_36109005.Text & "', " & Val(t3_36109005.Text) & "," & Val(t4_36109005.Text) & ")", BAGI)
        BAGI.Open()
        MI.ExecuteNonQuery()
        BAGI.Close()
        MI.Dispose()

        t1_36109005.Text = " "
        t2_36109005.Text = " "
        t3_36109005.Text = " "
        t4_36109005.Text = " "
    End Sub
End Class 
Latihan 32C

Public Class Latihan32C_36109005
    Dim IM As New OleDb.OleDbCommand
    Dim ISMI As New ByIskandar.CariKeDataBaseByIskandar
    Dim MI As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/Databarang.ACCDB")
    Private Sub Simpan_36109005_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Simpan_36109005.Click
        If t1_36109005.Text.Length = 0 Then
            MsgBox("Masukkan teks")
            Exit Sub
        End If

        If t2_36109005.Text.Length = 0 Then
            MsgBox("Masukkan teks")
            Exit Sub
        End If

        If Val(t3_36109005.Text) = 0 Then
            MsgBox("Masukkan teks")
            Exit Sub
        End If

        If Val(t4_36109005.Text) = 0 Then
            MsgBox("Masukkan teks")
            Exit Sub
        End If

        If kb_36109005.Text <> t1_36109005.Text Then

            ISMI.AturPencarianDataBase("Barang", "KodeBarang", t1_36109005.Text, 1, MI)
            If ISMI.JumlanBaris > 0 Then
                MsgBox("Kode Barang Sudah Ada")
                Exit Sub
            End If
        End If

        IM = New OleDb.OleDbCommand("update barang set kodebarang = '" & t1_36109005.Text & "', namabarang = '" & t2_36109005.Text & "', hargajual = " & Val(t3_36109005.Text) & ", jumlahbarang = " & Val(t4_36109005.Text) & " where kodebarang = '" & KB_36109005.Text & "'", MI)
        MI.Open()
        IM.ExecuteNonQuery()
        MI.Close()
        IM.Dispose()

        KB_36109005.Text = ""
        t1_36109005.Text = ""
        t2_36109005.Text = ""
        t3_36109005.Text = ""
        t4_36109005.Text = ""

        Latihan32A_36109005.ISMI()
    End Sub
End Class

Kamis, 24 November 2011

APKOM 4 (Latihan 29-30)

Latihan 29

Public Class Latihan29_36109005
    Dim MINNI As New OleDb.OleDbCommand
    Dim ISMI As New ByIskandar.CariKeDataBaseByIskandar
    Dim MICKY As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/Databarang.ACCDB")
    Private Sub Simpan_36109005_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Simpan_36109005.Click
        If t1_36109005.Text.Length = 0 Then
            MsgBox("Masukkan teks")
            Exit Sub
        End If

        If t2_36109005.Text.Length = 0 Then
            MsgBox("Masukkan teks")
            Exit Sub
        End If

        If Val(t3_36109005.Text) = 0 Then
            MsgBox("Masukkan teks")
            Exit Sub
        End If

        If Val(t4_36109005.Text) = 0 Then
            MsgBox("Masukkan teks")
            Exit Sub
        End If

        If kb_36109005.Text <> t1_36109005.Text Then

            ISMI.AturPencarianDataBase("Barang", "KodeBarang", t1_36109005.Text, 1, MICKY)
            If ISMI.JumlanBaris > 0 Then
                MsgBox("Kode Barang Sudah Ada")
                Exit Sub
            End If
        End If

        MINNI = New OleDb.OleDbCommand("update barang set kodebarang = '" & t1_36109005.Text & "', namabarang = '" & t2_36109005.Text & "', hargajual = " & Val(t3_36109005.Text) & ", jumlahbarang = " & Val(t4_36109005.Text) & " where kodebarang = '" & kb_36109005.Text & "'", MICKY)
        MICKY.Open()
        MINNI.ExecuteNonQuery()
        MICKY.Close()
        MINNI.Dispose()

        kb_36109005.Text = ""
        t1_36109005.Text = ""
        t2_36109005.Text = ""
        t3_36109005.Text = ""
        t4_36109005.Text = ""
    End Sub
End Class

Latihan 30A

Public Class Latihan30A_36109005
    Dim DT As New DataTable
    Dim ICHMI As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/Databarang.ACCDB")
    Public Sub ISMI()
        Dim AD As New OleDb.OleDbDataAdapter
        AD = New OleDb.OleDbDataAdapter("select * from barang", ICHMI)
        DT.Rows.Clear()
        AD.Fill(DT)
        AD.Dispose()
    End Sub
    Private Sub Latihan30A_36109005_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ISMI()
        DGV_36109005.DataSource = DT
    End Sub
    Private Sub EDIT_36109005_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles EDIT_36109005.Click
        If Latihan30B_36109005.Visible = False Then
            Latihan30B_36109005.Show()
        Else
            Latihan30B_36109005.Activate()
        End If

        Latihan30B_36109005.kb_36109005.Text = DGV_36109005.CurrentRow.Cells("kodebarang").Value
        Latihan30B_36109005.t1_36109005.Text = DGV_36109005.CurrentRow.Cells("kodebarang").Value
        Latihan30B_36109005.t2_36109005.Text = DGV_36109005.CurrentRow.Cells("namabarang").Value
        Latihan30B_36109005.t3_36109005.Text = DGV_36109005.CurrentRow.Cells("hargajual").Value
        Latihan30B_36109005.t4_36109005.Text = DGV_36109005.CurrentRow.Cells("jumlahbarang").Value

        Latihan30B_36109005.Show()
    End Sub
End Class

Latihan 30B

Public Class Latihan30B_36109005
    Dim ISMI As New ByIskandar.CariKeDataBaseByIskandar
    Dim OD As New OleDb.OleDbCommand
    Dim DB As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/Databarang.ACCDB")
    Private Sub Simpan_36109005_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Simpan_36109005.Click
        If t1_36109005.Text.Length = 0 Then
            MsgBox("Masukkan teks")
            Exit Sub
        End If

        If t2_36109005.Text.Length = 0 Then
            MsgBox("Masukkan teks")
            Exit Sub
        End If

        If Val(t3_36109005.Text) = 0 Then
            MsgBox("Masukkan teks")
            Exit Sub
        End If

        If Val(t4_36109005.Text) = 0 Then
            MsgBox("Masukkan teks")
            Exit Sub
        End If

        If kb_36109005.Text <> t1_36109005.Text Then
            ISMI.AturPencarianDataBase("Barang", "KodeBarang", t1_36109005.Text, 1, DB)
            If ISMI.JumlanBaris > 0 Then
                MsgBox("Kode Barang Sudah Ada")
                Exit Sub
            End If
        End If

        OD = New OleDb.OleDbCommand("update barang set kodebarang = '" & t1_36109005.Text & "', namabarang = '" & t2_36109005.Text & "', hargajual = " & Val(t3_36109005.Text) & ", jumlahbarang = " & Val(t4_36109005.Text) & " where kodebarang = '" & kb_36109005.Text & "'", DB)

        DB.Open()
        OD.ExecuteNonQuery()
        DB.Close()
        OD.Dispose()

        kb_36109005.Text = ""
        t1_36109005.Text = ""
        t2_36109005.Text = ""
        t3_36109005.Text = ""
        t4_36109005.Text = ""

        Latihan30A_36109005.ISMI()
    End Sub

End Class

APKOM 4 (Latihan 27-28)

Latihan 27

Public Class Latihan27_36109005
    Dim Ismi As New ByIskandar.CariKeDataBaseByIskandar
    Dim KendaraanSimpan As New OleDb.OleDbCommand
    Dim Jalan As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source =" & Application.StartupPath & "\DataBarang.ACCDB")
    Private Sub Simpan_36109005_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Simpan_36109005.Click
        If t1_36109005.Text.Length = 0 Then
            MsgBox("Masukkan teks")
            Exit Sub
        End If

        If t2_36109005.Text.Length = 0 Then
            MsgBox("Masukkan teks")
            Exit Sub
        End If

        If Val(t3_36109005.Text) = 0 Then
            MsgBox("Masukkan Teks")
            Exit Sub
        End If

        If Val(t4_36109005.Text) = 0 Then
            MsgBox("Masukkan teks")
            Exit Sub
        End If

        Dim PENCARI As New ByIskandar.CariKeDataBaseByIskandar
        PENCARI.AturPencarianDataBase("BARANG", "KODEBARANG", t1_36109005.Text, 1, Jalan)

        If PENCARI.JumlanBaris > 0 Then
            MsgBox("Kode Barang Sudah Ada")

            t1_36109005.Text = " "
            t2_36109005.Text = " "
            t3_36109005.Text = " "
            t4_36109005.Text = " "
            Exit Sub
        End If

        Dim Cm As New OleDb.OleDbCommand
        Cm = New OleDb.OleDbCommand("INSERT INTO BARANG (KODEBARANG, NAMABARANG, HARGAJUAL, JUMLAHBARANG) VALUES ('" & t1_36109005.Text & "','" & t2_36109005.Text & "', " & Val(t3_36109005.Text) & "," & Val(t4_36109005.Text) & ")", Jalan)
        Jalan.Open()
        Cm.ExecuteNonQuery()
        Jalan.Close()
        Cm.Dispose()

        t1_36109005.Text = " "
        t2_36109005.Text = " "
        t3_36109005.Text = " "
        t4_36109005.Text = " "
    End Sub
End Class

Latihan 28A

Public Class Latihan28A_36109005
    Dim DT As New DataTable
    Dim IMMHY As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/Databarang.ACCDB")
    Public Sub ISMI()
        Dim IM As New OleDb.OleDbDataAdapter
        IM = New OleDb.OleDbDataAdapter("select * from barang", IMMHY)
        DT.Rows.Clear()
        IM.Fill(DT)
        IM.Dispose()
    End Sub
    Private Sub Latihan28A_36109005_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ISMI()
        DGV_36109005.DataSource = DT
    End Sub
    Private Sub IN_36109005_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles IN_36109005.Click
        If Latihan28B_36109005.Visible = False Then
            Latihan28B_36109005.Show()
        Else
            Latihan28B_36109005.Activate()
        End If
    End Sub
    Private Sub TU_36109005_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TU_36109006.Click
        Close()
    End Sub

End Class

Latihan 28B

Public Class Latihan28B_36109005
    Dim Ismi As New ByIskandar.CariKeDataBaseByIskandar
    Dim KendaraanSimpan As New OleDb.OleDbCommand
    Dim Jalan As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source =" & Application.StartupPath & "\DataBarang.ACCDB")
    Private Sub Simpan_36109005_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Simpan_36109005.Click
        If t1_36109005.Text.Length = 0 Then
            MsgBox("Masukkan teks")
            Exit Sub
        End If

        If t2_36109005.Text.Length = 0 Then
            MsgBox("Masukkan teks")
            Exit Sub
        End If

        If Val(t3_36109005.Text) = 0 Then
            MsgBox("Masukkan Teks")
            Exit Sub
        End If

        If Val(t4_36109005.Text) = 0 Then
            MsgBox("Masukkan teks")
            Exit Sub
        End If

        Dim PENCARI As New ByIskandar.CariKeDataBaseByIskandar
        PENCARI.AturPencarianDataBase("BARANG", "KODEBARANG", t1_36109005.Text, 1, Jalan)

        If PENCARI.JumlanBaris > 0 Then
            MsgBox("Data sudah dimasukkan")

            t1_36109005.Text = " "
            t2_36109005.Text = " "
            t3_36109005.Text = " "
            t4_36109005.Text = " "
            Exit Sub
        End If

        Dim Cm As New OleDb.OleDbCommand
        Cm = New OleDb.OleDbCommand("INSERT INTO BARANG (KODEBARANG, NAMABARANG, HARGAJUAL, JUMLAHBARANG) VALUES ('" & t1_36109005.Text & "','" & t2_36109005.Text & "', " & Val(t3_36109005.Text) & "," & Val(t4_36109005.Text) & ")", Jalan)
        Jalan.Open()
        Cm.ExecuteNonQuery()
        Jalan.Close()
        Cm.Dispose()

        t1_36109005.Text = " "
        t2_36109005.Text = " "
        t3_36109005.Text = " "
        t4_36109005.Text = " "

    End Sub
End Class

Kamis, 17 November 2011

APKOM 4 (Latihan 23-26)

Latihan 23A
Public Class Latihan23A_36109005
    Dim BONEKA As New OleDb.OleDbConnection("provider=microsoft.ACE.oledb.12.0;data source=" & Application.StartupPath & "\datatransaksijualbeli.accdb")
    Dim DOLL As New DataTable
    Private Sub Latihan23A_36109005_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim adapter As New OleDb.OleDbDataAdapter
        adapter = New OleDb.OleDbDataAdapter("select* from mastertransaksi", BONEKA)
        DOLL.Rows.Clear()
        adapter.Fill(DOLL)
        adapter.Dispose()

        DGV_36109005.DataSource = DOLL


    End Sub
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If Latihan23B_36109005.Visible = False Then
            Latihan23B_36109005.Show()
        Else : Latihan23B_36109005.Activate()
        End If

        Latihan23B_36109005.N_36109005.Text = DGV_36109005.CurrentRow.Cells("NoTrans").Value
        Latihan23B_36109005.DT_36109005.Value = DGV_36109005.CurrentRow.Cells("TanggalTransaksi").Value
        Latihan23B_36109005.J_36109005.Text = DGV_36109005.CurrentRow.Cells("JenisTransaksi").Value

        Latihan23B_36109005.ISMI(Latihan23B_36109005.N_36109005.Text)

    End Sub
End Class
Latihan 23B
Public Class Latihan23B_36109005
    Dim BONEKA As New OleDb.OleDbConnection("provider=microsoft.ACE.oledb.12.0;data source=" & Application.StartupPath & "\datatransaksijualbeli.accdb")
    Dim DOLL As New DataTable
    Public Sub ISMI(ByVal A As String)
        Dim adapter As New OleDb.OleDbDataAdapter
        adapter = New OleDb.OleDbDataAdapter("select*from detailtransaksi where notrans='" & A & "'", BONEKA)
        DOLL.Rows.Clear()
        adapter.Fill(DOLL)

        DGV1_36109005.DataSource = DOLL


    End Sub
End Class
Latihan 24A
Public Class Latihan24A_36109005
    Dim NIM As New OleDb.OleDbConnection("provider=microsoft.ACE.oledb.12.0;data source=" & Application.StartupPath & "\datatransaksijualbeli.accdb")
    Dim NIT As New DataTable
    Private Sub Latihan24A_36109005_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim adapter As New OleDb.OleDbDataAdapter
        adapter = New OleDb.OleDbDataAdapter("select*from Barang", NIM)
        NIT.Rows.Clear()
        adapter.Fill(NIT)
        adapter.Dispose()

        DGVA_36109005.DataSource = NIT

    End Sub
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If Latihan24B_36109005.Visible = False Then
            Latihan24B_36109005.Show()
        Else : Latihan24B_36109005.Activate()
        End If

        Latihan24B_36109005.KB_36109005.Text = DGVA_36109005.CurrentRow.Cells("KodeBarang").Value
        Latihan24B_36109005.NB_36109005.Text = DGVA_36109005.CurrentRow.Cells("NamaBarang").Value
        Latihan24B_36109005.HJ_36109005.Text = DGVA_36109005.CurrentRow.Cells("PersediaanAwal").Value
        Latihan24B_36109005.JB_36109005.Text = DGVA_36109005.CurrentRow.Cells("HargaJual").Value

        Latihan24B_36109005.uly(Latihan24B_36109005.KB_36109005.Text)


    End Sub
End Class
Latihan 24B
Public Class Latihan24B_36109005
    Dim NIM As New OleDb.OleDbConnection("provider=microsoft.ACE.oledb.12.0;data source=" & Application.StartupPath & "\datatransaksijualbeli.accdb")
    Dim NIT As New DataTable
    Public Sub uly(ByVal A As String)
        Dim adapter As New OleDb.OleDbDataAdapter
        adapter = New OleDb.OleDbDataAdapter("select*from detailtransaksi where KodeBarang='" & A & "'", NIM)
        NIT.Rows.Clear()
        adapter.Fill(NIT)

        DGVB_36109005.DataSource = NIT

    End Sub
End Class
Latihan 25A
Public Class Latihan25A_36109005
    Dim NIM As New OleDb.OleDbConnection("provider=microsoft.ACE.oledb.12.0;data source=" & Application.StartupPath & "\datatransaksijualbeli.accdb")
    Dim NIT As New DataTable
    Private Sub Latihan25A_36109005_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim adapter As New OleDb.OleDbDataAdapter
        adapter = New OleDb.OleDbDataAdapter("select*from Barang", NIM)
        NIT.Rows.Clear()

APKOM 4 (Latihan 15-22)

Latihan 15
Public Class Latihan15_36109005
    Dim IMMY As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source= " & Application.StartupPath & "\DataTransaksiJualBeli.accdb")
    Dim DT As New DataTable
    Private Sub Latihan15_36109005_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim ICHMI As New OleDb.OleDbDataAdapter
        ICHMI = New OleDb.OleDbDataAdapter("select * from BARANG", IMMY)
        DT.Rows.Clear()
        ICHMI.Fill(DT)
        DGV_36109005.DataSource = DT

        ICHMI.Dispose()
    End Sub
End Class
Latihan 16
Public Class Latihan16_36109005
    Dim ISMI As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source= " & Application.StartupPath & "\DataTransaksiJualBeli.accdb")
    Dim DT As New DataTable
    Private Sub Latihan16_36109005_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim SAYA As New OleDb.OleDbDataAdapter
        SAYA = New OleDb.OleDbDataAdapter("select * from MASTERTRANSAKSI", ISMI)
        DT.Rows.Clear()
        SAYA.Fill(DT)
        DGV_36109005.DataSource = DT

        SAYA.Dispose()

    End Sub
End Class
Latihan 17
Public Class Latihan17_36109005
    Dim MINI As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Application.StartupPath & "\DataTransaksiJualBeli.accdb")
    Dim DT As New DataTable
    Private Sub Latihan17_36109005_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim MICKY As New OleDb.OleDbDataAdapter
        MICKY = New OleDb.OleDbDataAdapter("select * from DETAILTRANSAKSI", MINI)
      
 DT.Rows.Clear()
        MICKY.Fill(DT)
        DGV_36109005.DataSource = DT

        MICKY.Dispose()

    End Sub
End Class
Latihan 18
Public Class Latihan18_36109005
 Dim FEBRIANI As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Application.StartupPath & "\DataTransaksiJualBeli.accdb")
    Dim DT As New DataTable
    Private Sub Latihan18_36109005_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim RIANI As New OleDb.OleDbDataAdapter
        RIANI = New OleDb.OleDbDataAdapter("select * From Query4", FEBRIANI)
        DT.Rows.Clear()
        RIANI.Fill(DT)
        DGV_36109005.DataSource = DT

        RIANI.Dispose()

    End Sub
End Class
Latihan 19
Public Class Latihan19_36109005
    Dim IMY As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Application.StartupPath & "\DataTransaksiJualBeli.accdb")
    Dim DT As New DataTable
    Private Sub Latihan19_36109005_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim MIE As New OleDb.OleDbDataAdapter
        MIE = New OleDb.OleDbDataAdapter("select * From Query5", IMY)
        DT.Rows.Clear()
        MIE.Fill(DT)
        DGV_36109005.DataSource = DT

        MIE.Dispose()

    End Sub
End Class
Latihan 20
Public Class Latihan20_36109005
    Dim WINNY As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Application.StartupPath & "\DataTransaksiJualBeli.accdb")
    Dim DT As New DataTable
    Private Sub Latihan20_36109005_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim PEAR As New OleDb.OleDbDataAdapter
        PEAR = New OleDb.OleDbDataAdapter("select * From Query6", WINNY)
        DT.Rows.Clear()
        PEAR.Fill(DT)
        DGV_36109005.DataSource = DT

        PEAR.Dispose()

    End Sub
End Class 
Latihan 21
Public Class Latihan21_36109005
    Dim SHE As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Application.StartupPath & "\DataTransaksiJualBeli.accdb")

    Dim DT1 As New DataTable
    Dim DT2 As New DataTable

    Dim DS As New DataSet

    Dim BS1 As New BindingSource
    Dim BS2 As New BindingSource

    Private Sub Latihan21_36109005_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim KOTAK As New OleDb.OleDbDataAdapter
        Dim UNGU As New OleDb.OleDbDataAdapter

        KOTAK = New OleDb.OleDbDataAdapter("select * From MASTERTRANSAKSI", SHE)
        DT1.Rows.Clear()
        KOTAK.Fill(DT1)
        DGV1_36109005.DataSource = BS1

        KOTAK.Dispose()

        UNGU = New OleDb.OleDbDataAdapter("select * From DETAILTRANSAKSI", SHE)
        DT2.Rows.Clear()
        UNGU.Fill(DT2)
        DGV2_36109005.DataSource = BS2

        UNGU.Dispose()

        DS.Tables.Add(DT1)
        DS.Tables.Add(DT2)

        DT1.TableName = "TMM1"
        DT2.TableName = "TMM2"

        DS.Relations.Add(New DataRelation("mi", DS.Tables("TMM1").Columns("Notrans"), DS.Tables("TMM2").Columns("Notrans")))

        BS1.DataSource = DS
        BS1.DataMember = "TMM1"
        BS2.DataSource = BS1
        BS2.DataMember = "mi"

    End Sub
End Class
Latihan 22
Public Class Latihan22_36109005
    Dim MAN As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Application.StartupPath & "\DataTransaksiJualBeli.accdb")

    Dim IS1 As New DataTable
    Dim IS2 As New DataTable

    Dim MI As New DataSet

    Dim ISMI1 As New BindingSource
    Dim ISMI2 As New BindingSource
    Private Sub Latihan22_36109005_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim SEGITIGA As New OleDb.OleDbDataAdapter
        Dim BUNDAR As New OleDb.OleDbDataAdapter

        SEGITIGA = New OleDb.OleDbDataAdapter("select * From MASTERTRANSAKSI", MAN)
        IS1.Rows.Clear()
        SEGITIGA.Fill(IS1)
        DGV1_36109005.DataSource = ISMI1

        SEGITIGA.Dispose()


        BUNDAR = New OleDb.OleDbDataAdapter("select * From Query7", MAN)
        IS2.Rows.Clear()
        BUNDAR.Fill(IS2)
        DGV2_36109005.DataSource = ISMI2

        BUNDAR.Dispose()

        MI.Tables.Add(IS1)
        MI.Tables.Add(IS2)

        IS1.TableName = "III"
        IS2.TableName = "SSS"

        MI.Relations.Add(New DataRelation("feb", MI.Tables("III").Columns("Notrans"), MI.Tables("SSS").Columns("Notrans")))

        ISMI1.DataSource = MI
        ISMI1.DataMember = "III"
        ISMI2.DataSource = ISMI1
        ISMI2.DataMember = "feb"

    End Sub
End Class