Selasa, 03 Januari 2012

apkom4 latihan 43

latihan 43
Public Class latihan43_36109017
    Dim CONECT As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\DATA GRAFIK.accdb;jet OLEDB:database password=apa")
    Dim DT As New DataTable

    Private Sub latihan43_36109017_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim uphy As New OleDb.OleDbDataAdapter
        uphy = New OleDb.OleDbDataAdapter("select * from qpembelianperjenisbarang", CONECT)
        DT.Rows.Clear()
        uphy.Fill(DT)
        dgv36109017.DataSource = DT

        uphy.Dispose()
        chart36109017.ColumnCount = 3
        chart36109017.RowCount = DT.Rows.Count

        Dim POSISIBARIS As Integer = 0

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

            chart36109017.RowLabel = x("kode barang")

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

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

            chart36109017.Column = 3
            chart36109017.Data = x("jumlah") / 10000
        Next

    End Sub
End Class

0 komentar:

:a: :b: :c: :d: :e: :f: :g: :h: :i: :j: :k: :l: :m: :n:

Posting Komentar