Jumat, 18 November 2011

Latihan 43 APKOM 4 D3A

4 komentar:

  1. Public Class Form43_36109003
    Dim ndut As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\DATA GRAFIK.accdb")
    Dim anto As New DataTable

    Private Sub Form43_36109003_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    Dim soe = New OleDb.OleDbDataAdapter("select*from QPembelianPerJenisBarang", ndut)
    anto.Rows.Clear()

    soe.Fill(anto)
    dgv_36109003.DataSource = anto
    soe.Dispose()

    grafik_36109003.RowCount = anto.Rows.Count()
    grafik_36109003.ColumnCount = 3

    Dim PosisiBarisGrafik As Integer = 0
    For Each BarisX As DataRow In anto.Rows
    PosisiBarisGrafik = PosisiBarisGrafik + 1

    grafik_36109003.Row = PosisiBarisGrafik
    grafik_36109003.RowLabel = BarisX("KODE BARANG")

    grafik_36109003.Column = 1
    grafik_36109003.Data = BarisX("UNIT")

    grafik_36109003.Column = 2
    grafik_36109003.Data = BarisX("RATA-RATA HARGA") / 1000


    grafik_36109003.Column = 3
    grafik_36109003.Data = BarisX("JUMLAH") / 1000

    Next

    End Sub
    End Class

    BalasHapus
  2. Ismi Febriani A
    3a D3
    361 09 005

    Public Class Latihan43_36109005
    Dim ISMI As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\Data Grafik.accdb")
    Dim DT As New DataTable
    Private Sub Latihan43_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 qpembelianperjenisbarang", ISMI)
    DT.Rows.Clear()
    ICHMI.Fill(DT)
    DGV_36109005.DataSource = DT

    ICHMI.Dispose()

    Grafik_36109005.ColumnCount = 3
    Grafik_36109005.RowCount = DT.Rows.Count

    Dim POSISIBARIS As Integer = 0

    For Each x As DataRow In DT.Rows
    POSISIBARIS = POSISIBARIS + 1
    Grafik_36109005.Row = POSISIBARIS

    Grafik_36109005.RowLabel = x("kode barang")

    Grafik_36109005.Column = 1
    Grafik_36109005.Data = x("unit")

    Grafik_36109005.Column = 2
    Grafik_36109005.Data = x("rata-rata harga") / 1000

    Grafik_36109005.Column = 3
    Grafik_36109005.Data = x("jumlah") / 10000
    Next
    End Sub
    End Class

    BalasHapus
  3. Public Class Form43_36109001
    Dim imps As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/DATA GRAFIK.ACCDB")
    Dim rr As New DataTable

    Private Sub Latihan_43_022_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim a As New OleDb.OleDbDataAdapter
    a = New OleDb.OleDbDataAdapter("select * from qpembelianperjenisbarang", imps)
    rr.Rows.Clear()
    a.Fill(rr)
    a.Dispose()

    dgv.DataSource = rr

    apreal.ColumnCount = 3
    apreal.RowCount = rr.Rows.Count

    Dim apr As Integer = 0
    For Each x As DataRow In rr.Rows
    apr += 1

    apreal.Row = apr
    apreal.RowLabel = x("kode barang")

    apreal.Column = 1
    apreal.Data = x("unit")

    apreal.Column = 2
    apreal.Data = x("rata-rata harga") / 1000

    apreal.Column = 3
    apreal.Data = x("jumlah") / 10000
    Next
    End Sub
    End Class

    BalasHapus
  4. Public Class Form43_36109006
    Dim muhammad As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\DATA GRAFIK.accdb")
    Dim harun As New DataTable

    Private Sub Form43_36109006_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    Dim hma = New OleDb.OleDbDataAdapter("select*from QPembelianPerJenisBarang", muhammad)
    harun.Rows.Clear()

    hma.Fill(harun)
    dgv_36109006.DataSource = harun
    hma.Dispose()

    grafik_36109006.RowCount = harun.Rows.Count()
    grafik_36109006.ColumnCount = 3

    Dim PosisiBarisGrafik As Integer = 0
    For Each BarisX As DataRow In harun.Rows
    PosisiBarisGrafik = PosisiBarisGrafik + 1

    grafik_36109006.Row = PosisiBarisGrafik
    grafik_36109006.RowLabel = BarisX("KODE BARANG")

    grafik_36109006.Column = 1
    grafik_36109006.Data = BarisX("UNIT")

    grafik_36109006.Column = 2
    grafik_36109006.Data = BarisX("RATA-RATA HARGA") / 1000


    grafik_36109006.Column = 3
    grafik_36109006.Data = BarisX("JUMLAH") / 1000

    Next

    End Sub
    End Class

    BalasHapus