Deskripsi Latihan 13
A.
Object dalam
Latihan_13_36110030 :
Hanya ada terdapat satu object dalam
latihan ini yaitu datagridview. Terdapat 3 object datagridview. Digunakan untuk
menampilkan tabel yang telah dibuat dalam script.
B.
Script
Unique
Untuk script, akan ditampilkan
secara keseluruhan dalam prosedur Latihan_13_36110030.
C.
Even
Latihan_13_36110030_Load
Prosedur Penyelesaian Latihan 13
Prosedur Penyelesaian Latihan 13
1.KLIK STAR
KEMUDIAN PILIH MICROSOFT VISUAL STUDIO 2008
2.KEMUDIAN KLIK NEW PROJECT PADA FILE
3.KEMUDIAN KLIK ADD UNTUK MENAMBAHKAN
PROJECT
4. KEMUDIAN BUATLAH FORM SEPERTI DIBAWAH
INI :
5.KEMUDIAN MASUKAN RUMUS :
Public
Class Latihan_13_36110030
Dim DT1 As New DataTable
Dim DT2 As New DataTable
Dim DT3 As New DataTable
Dim DS As New DataSet
Dim DBS1 As New BindingSource
Dim DBS2 As New BindingSource
Dim DBS3 As New BindingSource
Private Sub Latihan_13_36110030_Load(ByVal
sender As Object,
ByVal e As
System.EventArgs) Handles Me.Load
DT1.Columns.Add(New DataColumn("Kode Rekening
Induk", GetType(String)))
DT1.Columns.Add(New DataColumn("Nama Rekening
Induk", GetType(String)))
DT2.Columns.Add(New DataColumn("Kode Rekening
Induk", GetType(String)))
DT2.Columns.Add(New DataColumn("Kode Rekening
Sub", GetType(String)))
DT2.Columns.Add(New DataColumn("Nama Rekening
Sub", GetType(String)))
DT3.Columns.Add(New DataColumn("Kode Rekening
Induk", GetType(String)))
DT3.Columns.Add(New DataColumn("Kode Rekening
Sub", GetType(String)))
DT3.Columns.Add(New DataColumn("Kode Rekening
Sub-Sub", GetType(String)))
DT3.Columns.Add(New DataColumn("Nama Rekening
Sub-Sub", GetType(String)))
Dim RPT
As New Random
For RI As Integer = 1 To RPT.Next(1, 5)
DT1.Rows.Add(RI, "Nama Rekening " & RI)
For
RS As Integer =
1 To RPT.Next(1, 5)
DT2.Rows.Add(RI, RI & RS, "Nama Sub Rekening " & RI & RS)
For
RSS As Integer
= 1 To RPT.Next(1, 5)
DT3.Rows.Add(RI, RI &
RS, RI & RS & RSS, "Nama Sub Sub
Rekening " & RI & RS & RSS)
Next
Next
Next
DS.Tables.Add(DT1)
DS.Tables.Add(DT2)
DS.Tables.Add(DT3)
DT1.TableName = "yy1"
DT2.TableName = "yy2"
DT3.TableName = "yy3"
DS.Relations.Add(New DataRelation("NR1",
DS.Tables("yy1").Columns("Kode Rekening Induk"), DS.Tables("yy2").Columns("Kode
Rekening Induk")))
DS.Relations.Add(New DataRelation("NR2",
DS.Tables("yy2").Columns("Kode Rekening Sub"), DS.Tables("yy3").Columns("Kode
Rekening sub")))
DBS1.DataSource = DS
DBS1.DataMember = "yy1"
DBS2.DataSource = DBS1
DBS2.DataMember = "NR1"
DBS3.DataSource = DBS2
DBS3.DataMember = "NR2"
DGV1_36110030.DataSource = DBS1
DGV2_36110030.DataSource = DBS2
DGV3_36110030.DataSource = DBS3
End Sub
Private Sub DGV3_36110030_CellContentClick(ByVal sender As
System.Object, ByVal e As
System.Windows.Forms.DataGridViewCellEventArgs) Handles
DGV3_36110030.CellContentClick
End Sub
Private Sub DGV2_36110030_CellContentClick(ByVal sender As
System.Object, ByVal e As
System.Windows.Forms.DataGridViewCellEventArgs) Handles
DGV2_36110030.CellContentClick
End Sub
Private Sub DGV1_36110030_CellContentClick(ByVal sender As
System.Object, ByVal e As
System.Windows.Forms.DataGridViewCellEventArgs) Handles
DGV1_36110030.CellContentClick
End Sub
End Class
6.
KEMUDIAN UJI PROGRAM
7.
JIKA SUDAH BERHASIL Save program anda
8.
selesai
0 komentar:
Posting Komentar