Public Class Form31A_36109020
Dim dtb As New DataTable
Dim ksr As New OleDb.OleDbConnection("PROVIDER = MICROSOFT.ACE.OLEDB.12.0; DATA SOURCE =" & Application.StartupPath & "/Databarang.ACCDB")
Public Sub dhedhe()
Dim df As New OleDb.OleDbDataAdapter
df = New OleDb.OleDbDataAdapter("select * from barang", ksr)
dtb.Rows.Clear()
df.Fill(dtb)
df.Dispose()
End Sub
Private Sub Form31A_36109020_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
dhedhe()
dgv_36109020.DataSource = dtb
End Sub
Private Sub edit_36109020_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles edit_36109020.Click
If Form31B_36109020.Visible = False Then
Form31B_36109020.Show()
Else
Form31B_36109020.Activate()
End If
Form31B_36109020.t1_36109020.Text = dgv_36109020.CurrentRow.Cells("kodebarang").Value
Form31B_36109020.t2_36109020.Text = dgv_36109020.CurrentRow.Cells("namabarang").Value
Form31B_36109020.t3_36109020.Text = dgv_36109020.CurrentRow.Cells("hargajual").Value
Form31B_36109020.t4_36109020.Text = dgv_36109020.CurrentRow.Cells("jumlahbarang").Value
Form31B_36109020.KB_36109020.Text = dgv_36109020.CurrentRow.Cells("jumlahbarang").Value
Form31B_36109020.Show()
End Sub
End Class
Tidak ada komentar:
Posting Komentar