latihan 41
Public Class latihan41_36109017Dim CONECT As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\DATA GRAFIK.accdb")
Dim DT As New DataTable
Private Sub latihan41_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 KEUANGAN", CONECT)
DT.Rows.Clear()
uphy.Fill(DT)
Dgv_36109017.DataSource = DT
uphy.Dispose()
chart_36109017.ColumnCount = 2
chart_36109017.RowCount = DT.Rows.Count
Dim POSISIBARIS As Integer = 0
For Each x As DataRow In DT.Rows
POSISIBARIS = POSISIBARIS + 1
chart_36109017.Row = POSISIBARIS
chart_36109017.RowLabel = x("tahun")
chart_36109017.Column = 1
chart_36109017.Data = x("PENDAPATAN") / 1000
chart_36109017.Column = 2
chart_36109017.Data = x("BIAYA") / 1000
Next
End Sub
End Class

0 komentar:
Posting Komentar