![]() ![]() If dt.Rows.Count = 0 Then command = New OleDbCommand('INSERT INTO tb_penjualan(noFaktur,kodeBarang,QTY,total)values(' & tNoFaktur.Text & ',' & tKodeBarang.Text & ',' & tQty.Text & ',' & tTotal.Text & ')', koneksi) Dim hasil As Integer = command.ExecuteNonQuery If hasil > 0 Then MessageBox.Show('Transaksi berhasil diproses', 'Transaksi Faktur', MessageBoxButtons.OK, MessageBoxIcon.Information) kosongkan() refreshCombo() End If Else MessageBox.Show('Transaksi gagal diproses, no faktur sudah terdaftar', 'Transaksi Faktur', MessageBoxButtons.OK, MessageBoxIcon.Error) End If Catch ex As Exception Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Connect() If (Val(tTotal.Text) > 0) Then Try Dim dt As New DataTable Dim query = 'select * from tb_penjualan where noFaktur=' & tNoFaktur.Text & '' reader = New OleDbDataAdapter(query, koneksi) reader.Fill(dt) Try koneksi = New OleDbConnection(koneksiString) koneksi.Open() Me.Text = 'Form Penjualan Barang' koneksi.Close() Catch ex As Exception MessageBox.Show('Koneksi Error : ' + ex.Message) End Try PERPUSTAKAANKuliahSemester 5Visual ProgrammingaplikasiPenjualanSederhanandb_penjualan.accdb' KoneksiString = 'Provider=.12.0 Data Source=E:02. ![]() ![]() Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load If Not koneksi Is Nothing Then koneksi.Close() Public Class Form1 Public koneksi As OleDbConnection = Nothing Public command As OleDbCommand = Nothing Public reader As OleDbDataAdapter = Nothing Function Connect() If Not koneksi Is Nothing Then koneksi.Close() End If koneksi.Open() Return koneksi End Function Function Closedd() koneksi.Close() Return koneksi End Function ICON PROGRAM VB PENJUALAN DENGAN MENYEBUT CODESource Code aplikasi: Imports Imports word = ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |