#Source Code
Imports System.Data
Imports System.Data.OleDb
Public Class tiket
Inherits System.Web.UI.Page
Dim Koneksi As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\ASUS\Documents\Dbtiket.mdb"
Dim objekKoneksi As New OleDb.OleDbConnection(Koneksi)
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub
Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles simpan.Click
objekKoneksi.Open()
Dim tambah As String = "INSERT INTO Dbtiket values('" & jeniskereta.Text & "','" & kelas.Text & "','" & hargatiket.Text & "','" & jumlah.Text & "') "
Dim oCmd = New OleDbCommand(tambah, objekKoneksi)
oCmd.ExecuteNonQuery()
objekKoneksi.Close()
MsgBox("Sukses")
End Sub
Protected Sub hapus_Click(sender As Object, e As EventArgs) Handles hapus.Click
jeniskereta.Text = ""
kelas.Text = ""
hargatiket.Text = ""
jumlah.Text = ""
jeniskereta.Focus()
End Sub
Protected Sub data_Click(sender As Object, e As EventArgs) Handles data.Click
Response.Redirect("krl.aspx")
End Sub
Protected Sub jeniskereta_TextChanged(sender As Object, e As EventArgs) Handles jeniskereta.TextChanged
End Sub
End Class
Tidak ada komentar:
Posting Komentar