Jumat, 04 November 2011

Latihan 31 Apkom 4 D3 B

41 komentar:

  1. Public Class Latihan31a035
    Dim Jalan As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source =D:\materi kuliah II\semester 5\VB\LATIHAN 27-34 SIMPAN EDIT DELETE DATA\DATABARANG.accdb")
    Dim ambil As New DataTable
    Public Sub ambildata()
    'mendeklarasikan adapter
    Dim data As New OleDb.OleDbDataAdapter

    'Mengatur data yang akan di angkut
    data = New OleDb.OleDbDataAdapter("SELECT* FROM barang", Jalan)

    'bersihkan data dulu sebelum isi data lain
    ambil.Rows.Clear()

    'untuk memasukkan data yg telah di angkut ke dalam datatable
    data.Fill(ambil)
    data.Dispose()

    End Sub

    Private Sub Latihan31a035_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    ambildata()
    DataGridView1035.DataSource = ambil
    End Sub

    Private Sub Button1035_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1035.Click
    'Menampilkan form 31b
    If Latihan31b035.Visible = False Then
    Latihan31b035.Show()
    Else
    Latihan31b035.Activate()
    End If

    'mengisi textbox yang ada
    Latihan31b035.KB.Text = DataGridView1035.CurrentRow.Cells("KODEBARANG").Value
    Latihan31b035.t1035.Text = DataGridView1035.CurrentRow.Cells("KODEBARANG").Value
    Latihan31b035.t2035.Text = DataGridView1035.CurrentRow.Cells("NAMABARANG").Value
    Latihan31b035.t3035.Text = DataGridView1035.CurrentRow.Cells("HARGAJUAL").Value
    Latihan31b035.t4035.Text = DataGridView1035.CurrentRow.Cells("JUMLAHBARANG").Value
    End Sub
    End Class

    BalasHapus
  2. Public Class Latihan31b035
    Dim Jalan As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source =D:\materi kuliah II\semester 5\VB\LATIHAN 27-34 SIMPAN EDIT DELETE DATA\DATABARANG.accdb")

    Private Sub Button1035_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1035.Click
    'perintah periksa data
    If t1035.Text.Length = 0 Then
    MsgBox("Plase Insert Your Text")
    Exit Sub
    End If

    If t2035.Text.Length = 0 Then
    MsgBox("Plase Insert Your Text")
    Exit Sub
    End If

    If Val(t3035.Text) = 0 Then
    MsgBox("Plase Insert Your Text")
    Exit Sub
    End If

    If Val(t4035.Text) = 0 Then
    MsgBox("Plase Insert Your Text")
    Exit Sub
    End If
    'perintah ambil data

    If KB.Text <> t1035.Text Then
    Dim PENCARI As New ByIskandar.CariKeDataBaseByIskandar
    PENCARI.AturPencarianDataBase("BARANG", "KODEBARANG", t1035.Text, 1, Jalan)

    If PENCARI.JumlanBaris > 0 Then
    MsgBox("The data has been exist please insert new data")

    'mengosongkan text box
    t1035.Text = " "
    t2035.Text = " "
    t3035.Text = " "
    t4035.Text = " "
    Exit Sub
    End If
    End If

    'deklarasi object command
    Dim Cm As New OleDb.OleDbCommand
    Cm = New OleDb.OleDbCommand("Update BARANG set KODEBARANG ='" & t1035.Text & "', NAMABARANG = '" & t2035.Text & "', HARGAJUAL=" & Val(t3035.Text) & ", JUMLAHBARANG=" & Val(t4035.Text) & " where KODEBARANG='" & KB.Text & "'", Jalan)
    Jalan.Open()
    Cm.ExecuteNonQuery()
    Jalan.Close()
    Cm.Dispose()

    'mengosongkan text box
    KB.Text = "-"
    t1035.Text = " "
    t2035.Text = " "
    t3035.Text = " "
    t4035.Text = " "

    'mengambil data
    Latihan31a035.ambildata()

    'menutup form
    Me.Close()
    End Sub
    End Class

    BalasHapus
  3. Public Class Latihan031A36109033
    Dim CONECT As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\databarang.accdb")
    Dim tiwi As New DataTable
    Private Sub latihan153619033_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim cobajaa As New OleDb.OleDbDataAdapter
    cobajaa = New OleDb.OleDbDataAdapter("select * from barang", CONECT)
    cobajaa.Fill(tiwi)
    DataGridView1.DataSource = tiwi
    End Sub
    Private Sub Button136109033_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109033.Click
    If Latihan031B36109033.Visible = False Then
    Latihan031B36109033.Show()
    Else
    Latihan031B36109033.Activate()
    End If
    Latihan031B36109033.t136109033.Text = DataGridView1.CurrentRow.Cells("KodeBarang").Value
    Latihan031B36109033.ToolStripStatusLabel1.Text = "kode barang lama = " & DataGridView1.CurrentRow.Cells("KodeBarang").Value
    Latihan031B36109033.t236109033.Text = DataGridView1.CurrentRow.Cells("NamaBarang").Value
    Latihan031B36109033.t336109033.Text = DataGridView1.CurrentRow.Cells("Hargajual").Value
    Latihan031B36109033.t436109033.Text = DataGridView1.CurrentRow.Cells("jumlahbarang").Value
    End Sub

    End Class

    Public Class Latihan031B36109033
    Dim CONECT As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb")
    Private Sub Button136109033_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109033.Click

    If Val(t136109033.Text) = 0 Then
    MsgBox("kode barang belum terisi")
    Exit Sub
    End If

    If t236109033.Text.Length = 0 Then
    MsgBox("nama barang belum terisi")
    Exit Sub
    End If

    If Val(t336109033.Text) = 0 Then
    MsgBox("harga jual belum diisi")
    Exit Sub
    End If

    If Val(t436109033.Text) = 0 Then
    MsgBox("jumlah barang belum diisi")
    Exit Sub
    End If

    Dim com As New OleDb.OleDbCommand
    com = New OleDb.OleDbCommand("UPDATE BARANG SET kodebarang = '" & t136109033.Text & "', namabarang = '" & t236109033.Text & "', hargajual = " & Val(t336109033.Text) & ", jumlahbarang = " & Val(t436109033.Text) & " where kodebarang ='" & ToolStripStatusLabel1.Text & "'", CONECT)

    CONECT.Open()
    com.ExecuteNonQuery()
    CONECT.Close()
    com.Dispose()

    t136109033.Text = ""
    t236109033.Text = ""
    t336109033.Text = ""
    t436109033.Text = ""

    End Sub

    End Class

    BalasHapus
  4. revisi :)

    Public Class Latihan031A36109033
    Dim CONECT As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=tahir")
    Dim tiwi As New DataTable
    Private Sub latihan153619033_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim cobajaa As New OleDb.OleDbDataAdapter
    cobajaa = New OleDb.OleDbDataAdapter("select * from barang", CONECT)
    cobajaa.Fill(tiwi)
    DataGridView1.DataSource = tiwi
    End Sub
    Private Sub Button136109033_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109033.Click
    If Latihan031B36109033.Visible = False Then
    Latihan031B36109033.Show()
    Else
    Latihan031B36109033.Activate()
    End If
    Latihan031B36109033.t136109033.Text = DataGridView1.CurrentRow.Cells("KodeBarang").Value
    Latihan031B36109033.ToolStripStatusLabel1.Text = "kode barang lama = " & DataGridView1.CurrentRow.Cells("KodeBarang").Value
    Latihan031B36109033.t236109033.Text = DataGridView1.CurrentRow.Cells("NamaBarang").Value
    Latihan031B36109033.t336109033.Text = DataGridView1.CurrentRow.Cells("Hargajual").Value
    Latihan031B36109033.t436109033.Text = DataGridView1.CurrentRow.Cells("jumlahbarang").Value
    End Sub

    End Class
    Public Class Latihan031B36109033
    Dim CONECT As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=tahir")
    Private Sub Button136109033_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109033.Click

    If Val(t136109033.Text) = 0 Then
    MsgBox("kode barang belum terisi")
    Exit Sub
    End If

    If t236109033.Text.Length = 0 Then
    MsgBox("nama barang belum terisi")
    Exit Sub
    End If

    If Val(t336109033.Text) = 0 Then
    MsgBox("harga jual belum diisi")
    Exit Sub
    End If

    If Val(t436109033.Text) = 0 Then
    MsgBox("jumlah barang belum diisi")
    Exit Sub
    End If

    Dim com As New OleDb.OleDbCommand
    com = New OleDb.OleDbCommand("UPDATE BARANG SET kodebarang = '" & t136109033.Text & "', namabarang = '" & t236109033.Text & "', hargajual = " & Val(t336109033.Text) & ", jumlahbarang = " & Val(t436109033.Text) & " where kodebarang ='" & ToolStripStatusLabel1.Text & "'", CONECT)

    CONECT.Open()
    com.ExecuteNonQuery()
    CONECT.Close()
    com.Dispose()

    t136109033.Text = ""
    t236109033.Text = ""
    t336109033.Text = ""
    t436109033.Text = ""

    End Sub

    End Class

    BalasHapus
  5. Public Class LATIHAN31A36109040
    Dim Jalan As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb;Jet OLEDB:Database Password=1509040")
    Dim ambil As New DataTable
    Public Sub ambildata()
    'mendeklarasikan adapter
    Dim data As New OleDb.OleDbDataAdapter

    'Mengatur data yang akan di angkut
    data = New OleDb.OleDbDataAdapter("SELECT* FROM barang", Jalan)

    'bersihkan data dulu sebelum isi data lain
    ambil.Rows.Clear()

    'untuk memasukkan data yg telah di angkut ke dalam datatable
    data.Fill(ambil)
    data.Dispose()

    End Sub

    Private Sub LATIHAN31A36109040_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    ambildata()
    DataGridView1.DataSource = ambil
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    'Menampilkan form 31b
    If LATIHAN31B36109040.Visible = False Then
    LATIHAN31B36109040.Show()
    Else
    LATIHAN31B36109040.Activate()
    End If

    'mengisi textbox yang ada
    LATIHAN31B36109040.KB.Text = DataGridView1.CurrentRow.Cells("KODEBARANG").Value
    LATIHAN31B36109040.t1.Text = DataGridView1.CurrentRow.Cells("KODEBARANG").Value
    LATIHAN31B36109040.t2.Text = DataGridView1.CurrentRow.Cells("NAMABARANG").Value
    LATIHAN31B36109040.t3.Text = DataGridView1.CurrentRow.Cells("HARGAJUAL").Value
    LATIHAN31B36109040.t4.Text = DataGridView1.CurrentRow.Cells("JUMLAHBARANG").Value
    End Sub
    End Class

    BalasHapus
  6. Public Class Latihan_031A_36109056
    Dim conect As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=2422")
    Dim hasbiya As New DataTable
    Dim baris As DataRow
    Private Sub Latihan_031A_36109056_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim cobaji As New OleDb.OleDbDataAdapter
    cobaji = New OleDb.OleDbDataAdapter("select * from barang", conect)
    cobaji.Fill(hasbiya)
    DataGridView1.DataSource = hasbiya
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    If Latihan_031B_36109056.Visible = False Then
    Latihan_031B_36109056.Show()
    Else
    Latihan_031B_36109056.Activate()
    End If
    Latihan_031B_36109056.t1_36109056.Text = DataGridView1.CurrentRow.Cells("KodeBarang").Value
    Latihan_031B_36109056.ToolStripStatusLabel1.Text = DataGridView1.CurrentRow.Cells("KodeBarang").Value
    Latihan_031B_36109056.t2_36109056.Text = DataGridView1.CurrentRow.Cells("NamaBarang").Value
    Latihan_031B_36109056.t3_36109056.Text = DataGridView1.CurrentRow.Cells("Hargajual").Value
    Latihan_031B_36109056.t4_36109056.Text = DataGridView1.CurrentRow.Cells("jumlahbarang").Value
    End Sub
    End Class


    Public Class Latihan_031B_36109056
    Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=2422")
    Dim cari As New ByIskandar.CariKeDataBaseByIskandar

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    If Val(t1_36109056.Text) = 0 Then
    MsgBox("kode barang belum terisi")
    Exit Sub
    End If

    If t2_36109056.Text.Length = 0 Then
    MsgBox("nama barang belum terisi")
    Exit Sub
    End If

    If Val(t3_36109056.Text) = 0 Then
    MsgBox("harga jual belum diisi")
    Exit Sub
    End If

    If Val(t4_36109056.Text) = 0 Then
    MsgBox("jumlah barang belum diisi")
    Exit Sub
    End If

    Dim com As New OleDb.OleDbCommand
    com = New OleDb.OleDbCommand("UPDATE BARANG SET kodebarang = '" & t1_36109056.Text & "', namabarang = '" & t2_36109056.Text & "', hargajual = " & Val(t3_36109056.Text) & ", jumlahbarang = " & Val(t4_36109056.Text) & " where kodebarang ='" & ToolStripStatusLabel1.Text & "'", conect)

    conect.Open()
    com.ExecuteNonQuery()
    conect.Close()
    com.Dispose()

    t1_36109056.Text = ""
    t2_36109056.Text = ""
    t3_36109056.Text = ""
    t4_36109056.Text = ""

    End Sub
    End Class

    BalasHapus
  7. Public Class Latihan031A012
    Dim Connect As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\databarang.accdb")
    Dim Ijal As New DataTable
    Private Sub latihan153619043_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim cobaji As New OleDb.OleDbDataAdapter
    cobaji = New OleDb.OleDbDataAdapter("select * from barang", Connect)
    cobaji.Fill(Ijal)
    DataGridView1.DataSource = Ijal
    End Sub
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    If Lat31B36109042.Visible = False Then
    Lat31B36109042.Show()
    Else
    Lat31B36109042.Activate()
    End If
    Lat31B36109042.t136109042.Text = DataGridView1.CurrentRow.Cells("KodeBarang").Value
    Lat31B36109042.ToolStripStatusLabel1.Text = "kode barang lama = " & DataGridView1.CurrentRow.Cells("KodeBarang").Value
    Lat31B36109042.t236109042.Text = DataGridView1.CurrentRow.Cells("NamaBarang").Value
    Lat31B36109042.t336109042.Text = DataGridView1.CurrentRow.Cells("Hargajual").Value
    Lat31B36109042.t436109042.Text = DataGridView1.CurrentRow.Cells("jumlahbarang").Value
    End Sub

    End Class

    BalasHapus
  8. Public Class Lat31B36109042
    Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb")
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109042.Click

    If Val(t136109042.Text) = 0 Then
    MsgBox("kode barang belum terisi")
    Exit Sub
    End If

    If t236109042.Text.Length = 0 Then
    MsgBox("nama barang belum terisi")
    Exit Sub
    End If

    If Val(t336109042.Text) = 0 Then
    MsgBox("harga jual belum diisi")
    Exit Sub
    End If

    If Val(t436109042.Text) = 0 Then
    MsgBox("jumlah barang belum diisi")
    Exit Sub
    End If

    Dim com As New OleDb.OleDbCommand
    com = New OleDb.OleDbCommand("UPDATE BARANG SET kodebarang = '" & t136109042.Text & "', namabarang = '" & t236109042.Text & "', hargajual = " & Val(t336109042.Text) & ", jumlahbarang = " & Val(t436109042.Text) & " where kodebarang ='" & ToolStripStatusLabel1.Text & "'", conect)

    conect.Open()
    com.ExecuteNonQuery()
    conect.Close()
    com.Dispose()

    t136109042.Text = ""
    t236109042.Text = ""
    t336109042.Text = ""
    t436109042.Text = ""

    End Sub
    End Class

    BalasHapus
  9. Public Class Form31A36109050
    Dim Jalan As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb;Jet OLEDB:Database Password=nideria")
    Dim ambil As New DataTable
    Public Sub ambildata()

    Dim data As New OleDb.OleDbDataAdapter
    data = New OleDb.OleDbDataAdapter("SELECT* FROM barang", Jalan)
    ambil.Rows.Clear()
    data.Fill(ambil)
    data.Dispose()

    End Sub

    Private Sub Form31A36109050_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    ambildata()
    DataGridView1.DataSource = ambil
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

    If Form31B36109050.Visible = False Then
    Form31B36109050.Show()
    Else
    Form31B36109050.Activate()
    End If

    Form31B36109050.KB.Text = DataGridView1.CurrentRow.Cells("KODEBARANG").Value
    Form31B36109050.t1.Text = DataGridView1.CurrentRow.Cells("KODEBARANG").Value
    Form31B36109050.t2.Text = DataGridView1.CurrentRow.Cells("NAMABARANG").Value
    Form31B36109050.t3.Text = DataGridView1.CurrentRow.Cells("HARGAJUAL").Value
    Form31B36109050.t4.Text = DataGridView1.CurrentRow.Cells("JUMLAHBARANG").Value
    End Sub
    End Class


    Public Class Form31B36109050
    Dim Jalan As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb;Jet OLEDB:Database Password=nideria")

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

    If t1.Text.Length = 0 Then
    MsgBox("Plase Insert Your Text")
    Exit Sub
    End If

    If t2.Text.Length = 0 Then
    MsgBox("Plase Insert Your Text")
    Exit Sub
    End If

    If Val(t3.Text) = 0 Then
    MsgBox("Plase Insert Your Text")
    Exit Sub
    End If

    If Val(t4.Text) = 0 Then
    MsgBox("Plase Insert Your Text")
    Exit Sub
    End If

    If KB.Text <> t1.Text Then
    Dim PENCARI As New ByIskandar.CariKeDataBaseByIskandar
    PENCARI.AturPencarianDataBase("BARANG", "KODEBARANG", t1.Text, 1, Jalan)

    If PENCARI.JumlanBaris > 0 Then
    MsgBox("The data has been exist please insert new data")

    t1.Text = " "
    t2.Text = " "
    t3.Text = " "
    t4.Text = " "
    Exit Sub
    End If
    End If

    Dim Cm As New OleDb.OleDbCommand
    Cm = New OleDb.OleDbCommand("Update BARANG set KODEBARANG ='" & t1.Text & "', NAMABARANG = '" & t2.Text & "', HARGAJUAL=" & Val(t3.Text) & ", JUMLAHBARANG=" & Val(t4.Text) & " where KODEBARANG='" & KB.Text & "'", Jalan)
    Jalan.Open()
    Cm.ExecuteNonQuery()
    Jalan.Close()
    Cm.Dispose()

    KB.Text = "-"
    t1.Text = " "
    t2.Text = " "
    t3.Text = " "
    t4.Text = " "

    Form31A36109050.ambildata()
    Me.Close()
    End Sub
    End Class

    BalasHapus
  10. Public Class Latihan31A36109044
    Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=magfirah")
    Dim firah As New DataTable

    Private Sub Latihan31A36109044_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim tes As New OleDb.OleDbDataAdapter
    tes = New OleDb.OleDbDataAdapter("select * from barang", conect)
    tes.Fill(firah)
    DataGridView1.DataSource = firah

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    If Latihan31B36109044.Visible = False Then
    Latihan31B36109044.Show()
    Else
    Latihan31B36109044.Activate()
    End If
    Latihan31B36109044.t1.Text = DataGridView1.CurrentRow.Cells("KodeBarang").Value
    Latihan31B36109044.ToolStripStatusLabel1.Text = "kode barang lama = " & DataGridView1.CurrentRow.Cells("KodeBarang").Value
    Latihan31B36109044.t2.Text = DataGridView1.CurrentRow.Cells("NamaBarang").Value
    Latihan31B36109044.t3.Text = DataGridView1.CurrentRow.Cells("Hargajual").Value
    Latihan31B36109044.t4.Text = DataGridView1.CurrentRow.Cells("jumlahbarang").Value

    End Sub
    End Class

    BalasHapus
  11. Public Class Latihan31B36109044
    Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=magfirah")
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    If Val(t1.Text) = 0 Then
    MsgBox("kode barang belum terisi")
    Exit Sub
    End If

    If t2.Text.Length = 0 Then
    MsgBox("nama barang belum terisi")
    Exit Sub
    End If

    If Val(t3.Text) = 0 Then
    MsgBox("harga jual belum diisi")
    Exit Sub
    End If

    If Val(t4.Text) = 0 Then
    MsgBox("jumlah barang belum diisi")
    Exit Sub
    End If

    Dim com As New OleDb.OleDbCommand
    com = New OleDb.OleDbCommand("UPDATE BARANG SET kodebarang = '" & t1.Text & "', namabarang = '" & t2.Text & "', hargajual = " & Val(t3.Text) & ", jumlahbarang = " & Val(t4.Text) & " where kodebarang ='" & ToolStripStatusLabel1.Text & "'", conect)

    conect.Open()
    com.ExecuteNonQuery()
    conect.Close()
    com.Dispose()

    t1.Text = ""
    t2.Text = ""
    t3.Text = ""
    t4.Text = ""

    End Sub
    End Class

    BalasHapus
  12. Public Class LATIHAN031A36109032

    Dim sambung As New OleDb.OleDbConnection("provider=microsoft.ace.oledb.12.0;data source= " & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=jayapura")
    Dim pusat As New DataTable

    Private Sub LATIHAN031A36109032_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim lanjutkan As New OleDb.OleDbDataAdapter
    lanjutkan = New OleDb.OleDbDataAdapter("select * from barang", sambung)
    lanjutkan.Fill(pusat)
    DataGridView136109032.DataSource = pusat
    End Sub

    Private Sub Button136109032_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109032.Click
    If LATIHAN031B36109032.Visible = False Then
    LATIHAN031B36109032.Show()
    Else
    LATIHAN031B36109032.Activate()
    End If

    LATIHAN031B36109032.T136109032.Text = DataGridView136109032.CurrentRow.Cells("KodeBarang").Value
    LATIHAN031B36109032.ToolStripStatusLabel1.Text = "kode barang lama = " & DataGridView136109032.CurrentRow.Cells("KodeBarang").Value
    LATIHAN031B36109032.T236109032.Text = DataGridView136109032.CurrentRow.Cells("NamaBarang").Value
    LATIHAN031B36109032.T336109032.Text = DataGridView136109032.CurrentRow.Cells("Hargajual").Value
    LATIHAN031B36109032.T436109032.Text = DataGridView136109032.CurrentRow.Cells("jumlahbarang").Value
    End Sub

    End Class

    BalasHapus
  13. Public Class LATIHAN031B36109032

    Dim sambung As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=jayapura")

    Private Sub Button136109032_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109032.Click

    If Val(T136109032.Text) = 0 Then
    MsgBox("kode barang belum terisi")
    Exit Sub
    End If

    If T236109032.Text.Length = 0 Then
    MsgBox("nama barang belum terisi")
    Exit Sub
    End If

    If Val(T336109032.Text) = 0 Then
    MsgBox("harga jual belum diisi")
    Exit Sub
    End If

    If Val(T436109032.Text) = 0 Then
    MsgBox("jumlah barang belum diisi")
    Exit Sub
    End If

    Dim com As New OleDb.OleDbCommand
    com = New OleDb.OleDbCommand("UPDATE BARANG SET kodebarang = '" & T136109032.Text & "', namabarang = '" & T236109032.Text & "', hargajual = " & Val(T336109032.Text) & ", jumlahbarang = " & Val(T436109032.Text) & " where kodebarang ='" & ToolStripStatusLabel1.Text & "'", sambung)

    sambung.Open()
    com.ExecuteNonQuery()
    sambung.Close()
    com.Dispose()

    T136109032.Text = ""
    T236109032.Text = ""
    T336109032.Text = ""
    T436109032.Text = ""

    End Sub


    End Class

    BalasHapus
  14. Public Class Latihan31A36109046
    Dim Jalan As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb;Jet OLEDB:Database Password=14322836")
    Dim ambil As New DataTable
    Public Sub ambildata()
    Dim data As New OleDb.OleDbDataAdapter
    data = New OleDb.OleDbDataAdapter("SELECT* FROM barang", Jalan)
    ambil.Rows.Clear()
    data.Fill(ambil)
    data.Dispose()
    End Sub
    Private Sub Latihan31A36109046_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    ambildata()
    DataGridView136109046.DataSource = ambil
    End Sub
    Private Sub Button136109046_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109046.Click
    'Menampilkan form 31b
    If Latihan31B36109046.Visible = False Then
    Latihan31B36109046.Show()
    Else
    Latihan31B36109046.Activate()
    End If
    Latihan31B36109046.KB36109046.Text = DataGridView136109046.CurrentRow.Cells("KODEBARANG").Value
    Latihan31B36109046.t136109046.Text = DataGridView136109046.CurrentRow.Cells("KODEBARANG").Value
    Latihan31B36109046.t236109046.Text = DataGridView136109046.CurrentRow.Cells("NAMABARANG").Value
    Latihan31B36109046.t336109046.Text = DataGridView136109046.CurrentRow.Cells("HARGAJUAL").Value
    Latihan31B36109046.t436109046.Text = DataGridView136109046.CurrentRow.Cells("JUMLAHBARANG").Value
    End Sub
    End Class
    Public Class Latihan31B36109046
    Dim Jalan As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\DATABARANG.accdb;Jet OLEDB:Database Password=14322836")
    Private Sub Button136109046_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button136109046.Click
    If t136109046.Text.Length = 0 Then
    MsgBox("Plase Insert Your Text")
    Exit Sub
    End If
    If t236109046.Text.Length = 0 Then
    MsgBox("Plase Insert Your Text")
    Exit Sub
    End If
    If Val(t336109046.Text) = 0 Then
    MsgBox("Plase Insert Your Text")
    Exit Sub
    End If
    If Val(t436109046.Text) = 0 Then
    MsgBox("Plase Insert Your Text")
    Exit Sub
    End If
    'perintah ambil data
    If KB36109046.Text <> t136109046.Text Then
    Dim PENCARI As New ByIskandar.CariKeDataBaseByIskandar
    PENCARI.AturPencarianDataBase("BARANG", "KODEBARANG", t136109046.Text, 1, Jalan)
    If PENCARI.JumlanBaris > 0 Then
    MsgBox("The data has been exist please insert new data")
    t136109046.Text = " "
    t236109046.Text = " "
    t336109046.Text = " "
    t436109046.Text = " "
    Exit Sub
    End If
    End If
    Dim Cm As New OleDb.OleDbCommand
    Cm = New OleDb.OleDbCommand("Update BARANG set KODEBARANG ='" & t136109046.Text & "', NAMABARANG = '" & t236109046.Text & "', HARGAJUAL=" & Val(t336109046.Text) & ", JUMLAHBARANG=" & Val(t436109046.Text) & " where KODEBARANG='" & KB36109046.Text & "'", Jalan)
    Jalan.Open()
    Cm.ExecuteNonQuery()
    Jalan.Close()
    Cm.Dispose()
    KB36109046.Text = "-"
    t136109046.Text = " "
    t236109046.Text = " "
    t336109046.Text = " "
    t436109046.Text = " "
    Latihan31A36109046.ambildata()
    Me.Close()
    End Sub
    End Class

    BalasHapus
  15. Public Class Latihan_31A36109055
    Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb")
    Dim dtab As New DataTable
    Public Sub falah()
    Dim coba As New OleDb.OleDbDataAdapter
    coba = New OleDb.OleDbDataAdapter("select * from barang", conect)
    dtab.Rows.Clear()
    coba.Fill(dtab)
    coba.Dispose()

    End Sub
    Private Sub Latihan_A36109055_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    falah()
    DataGridView136109055.DataSource = dtab
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    If Latihan_31B36109055.Visible = False Then
    Latihan_31B36109055.Show()
    Else
    Latihan_31B36109055.Activate() 'jika sdh muncul tp dibelakang
    End If
    Latihan_31B36109055.KB.Text = DataGridView136109055.CurrentRow.Cells("KODEBARANG").Value
    Latihan_31B36109055.t136109055.Text = DataGridView136109055.CurrentRow.Cells("KODEBARANG").Value
    Latihan_31B36109055.t236109055.Text = DataGridView136109055.CurrentRow.Cells("NAMABARANG").Value
    Latihan_31B36109055.t336109055.Text = DataGridView136109055.CurrentRow.Cells("HARGAJUAL").Value
    Latihan_31B36109055.t436109055.Text = DataGridView136109055.CurrentRow.Cells("JUMLAHBARANG").Value
    End Sub
    End Class

    BalasHapus
  16. Public Class Latihan_31B36109055
    Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;Jet OLEDB:Database Password=25")
    Dim tes As New ByIskandar.CariKeDataBaseByIskandar

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    If t136109055.Text.Length = 0 Then
    MsgBox("kode barang belum terisi")
    Exit Sub
    End If

    If t236109055.Text.Length = 0 Then
    MsgBox("nama barang belum terisi")
    Exit Sub
    End If

    If Val(t336109055.Text) = 0 Then
    MsgBox("harga jual belum diisi")
    Exit Sub
    End If

    If Val(t436109055.Text) = 0 Then
    MsgBox("jumlah barang")
    Exit Sub
    End If

    If KB.Text <> t136109055.Text Then
    tes.AturPencarianDataBase("barang", "kodebarang", t136109055.Text, 1, conect)

    If tes.JumlanBaris > 0 Then
    MsgBox("kode sudah ada")
    Exit Sub
    End If
    End If


    Dim coba As New OleDb.OleDbCommand
    coba = New OleDb.OleDbCommand("update barang set kodebarang ='" & t136109055.Text & "',namabarang='" & t236109055.Text & "',hargajual=" & Val(t336109055.Text) & ", jumlahbarang=" & Val(t436109055.Text) & " where kodebarang='" & KB.Text & "'", conect)

    conect.Open() 'jembatannya dibuka
    coba.ExecuteNonQuery() 'jalankan perintahnya
    conect.Close() 'tutup jembatan
    coba.Dispose() 'hancurkan comand

    t136109055.Text = ""
    t236109055.Text = ""
    t336109055.Text = ""
    t436109055.Text = ""
    KB.Text = "-"


    Latihan_31A36109055.falah()

    End Sub

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

    End Sub
    End Class

    BalasHapus
  17. Public Class Latihan031B36109030

    Dim conect As New OleDb.OleDbConnection("provider = microsoft.ace.oledb.12.0;data source=" & Application.StartupPath & "\databarang.accdb;jet OLEDB:database password=sanie")
    Dim cari As New ByIskandar.CariKeDataBaseByIskandar
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

    If Val(t1.Text) = 0 Then
    MsgBox("kode barang belum terisi")
    Exit Sub
    End If

    If t2.Text.Length = 0 Then
    MsgBox("nama barang belum terisi")
    Exit Sub
    End If

    If Val(t3.Text) = 0 Then
    MsgBox("harga jual belum diisi")
    Exit Sub
    End If

    If Val(t4.Text) = 0 Then
    MsgBox("jumlah barang belum diisi")
    Exit Sub
    End If

    Dim com As New OleDb.OleDbCommand
    com = New OleDb.OleDbCommand("UPDATE BARANG SET kodebarang = '" & t1.Text & "', namabarang = '" & t2.Text & "', hargajual = " & Val(t3.Text) & ", jumlahbarang = " & Val(t4.Text) & " where kodebarang ='" & ToolStripStatusLabel1.Text & "'", conect)

    conect.Open()
    com.ExecuteNonQuery()
    conect.Close()
    com.Dispose()

    t1.Text = ""
    t2.Text = ""
    t3.Text = ""
    t4.Text = ""

    End Sub
    End Class

    BalasHapus
  18. http://hilariusmariotonapa.blogspot.com/2012/10/prosedur-penyelesaian-latihan31a36110048.html

    http://hilariusmariotonapa.blogspot.com/2012/10/deskripsi-latihan31a36110048.html


    http://hilariusmariotonapa.blogspot.com/2012/10/prosedur-penyelesaian-latihan31b36110048.html

    http://hilariusmariotonapa.blogspot.com/2012/10/deskripsi-latihan31b36110048.html

    BalasHapus
  19. http://nurrahmahrasyid2.blogspot.com/2012/10/latihan31a36110042.html

    http://nurrahmahrasyid2.blogspot.com/2012/10/latihan31b36110042.html

    BalasHapus
  20. http://ilhaazzahra.blogspot.com/2012/10/latihan31a36110033.html
    http://ilhaazzahra.blogspot.com/2012/10/latihan31b36110033.html

    BalasHapus
  21. http://rizka-azisah.blogspot.com/2012/10/deskripsi-penyelesaian_6249.html
    http://rizka-azisah.blogspot.com/2012/10/deskripsi-penyelesaian_3663.html

    BalasHapus
  22. http://andiniwarakusuma.blogspot.com/2012/10/latihan31a36110034.html
    http://andiniwarakusuma.blogspot.com/2012/10/latihan31b36110034.html

    BalasHapus
  23. http://rahmisuryatama05.blogspot.com/2012/10/latihan31a36110040_8343.html
    http://rahmisuryatama05.blogspot.com/2012/10/latihan31b36110040.html

    BalasHapus
  24. http://audryasharii.blogspot.com/2012/10/latihan31a36110031.html

    http://audryasharii.blogspot.com/2012/10/latihan31b36110031.html

    BalasHapus
  25. http://benhilll.blogspot.com/2012/10/deskripsi-dan-prosedur_3688.html

    http://benhilll.blogspot.com/2012/10/deskripsi-dan-prosedur_53.html

    BalasHapus
  26. http://rosyanausman.blogspot.com/2012/10/latihan31a36110036.html
    http://rosyanausman.blogspot.com/2012/10/latihan31b36110036.html

    BalasHapus
  27. http://sriayu-36110030.blogspot.com/2012/10/diskripsi-prosedur-latihan-31-a.html
    http://sriayu-36110030.blogspot.com/2012/10/diskripsi-prosedur-latihan-31-b.html

    BalasHapus
  28. http://rainaagrippinaa.blogspot.com/#!/2012/10/latihan31a36110032.html
    http://rainaagrippinaa.blogspot.com/#!/2012/10/latihan31b36110032_13.html

    BalasHapus
  29. http://tiya-sri.blogspot.com/2012/10/latihan31a36110044-aplikasi-komputer-4.html

    http://tiya-sri.blogspot.com/2012/10/latihan31b36110044-aplikasi-komputer-4.html

    BalasHapus
  30. http://reskypurwono.blogspot.com/2012/10/prosedur-penyelesaian-latihan31a36110037.html

    http://reskypurwono.blogspot.com/2012/10/prosedur-penyelesaian-latihan31b36110037.html

    BalasHapus
  31. http://03melisa.blogspot.com/2012/10/latihan-31a-36110051-apkom-4-d3b.html

    http://03melisa.blogspot.com/2012/10/latihan-31b-36110051-apkom-4-d3b.html

    BalasHapus
  32. http://burhankhang58.blogspot.com/2012/10/latihan31a36110047.html

    http://burhankhang58.blogspot.com/2012/10/latihan31b36110047.html

    BalasHapus
  33. http://eminaomi.blogspot.com/2012/10/latihan31a36110049.html

    http://eminaomi.blogspot.com/2012/10/latihan31b36110049.html

    BalasHapus
  34. http://masnurselayar.blogspot.com/2012/10/latihan-31a36110055.html

    http://masnurselayar.blogspot.com/2012/10/latihan-31b36110055.html

    BalasHapus
  35. http://dewiwahyuni91.blogspot.com/2012/10/latihan31a36110038.html

    http://dewiwahyuni91.blogspot.com/2012/10/latihan31b36110038.html

    BalasHapus
  36. http://ias-anakbola.blogspot.com/2012/10/latihan31a36110056.html
    http://ias-anakbola.blogspot.com/2012/10/latihan31b3611056.html

    BalasHapus
  37. http://hasfiahzain.blogspot.com/2012/10/latihan31a36110052.html


    http://hasfiahzain.blogspot.com/2012/10/latihan31b36110052.html

    BalasHapus
  38. http://nurhanalott.blogspot.com/2012/10/latihan31a36110029.html
    http://nurhanalott.blogspot.com/2012/10/latihan31b36110029.html

    BalasHapus
  39. http://zulkiflitryputra.blogspot.com/2012/10/latihan31a36110046.html

    http://zulkiflitryputra.blogspot.com/2012/10/latihan31b36110046.html

    BalasHapus
  40. http://sukadriady.blogspot.com/2012/10/latihan31a36110043.html
    http://sukadriady.blogspot.com/2012/10/latihan31b3610043_5492.html

    BalasHapus
  41. http://ruslancullank1.blogspot.com/2012/10/deskripsilatihan31a36110054.html
    http://ruslancullank1.blogspot.com/2012/10/deskripsilatihan31b36110054.html

    BalasHapus