Selamat malam kali ini saya membuat program
tentang cuci steam menggunakan aplikasi visual studio 2013 dan database pada
mc.acces , program ini memang sangat sederhana sekali karena memang masih dalam
proses belajar dan semoga kedepannya akan di perbaiki dan lebih bagus lagi
Ini adalah hasil desain outputnya yang sederhana
Ini adalah hasil desain inputnya
ini adalah hasil input di websitenya
Ini adalah source codenya
Imports
System.Data
Imports
System.Data.SqlClient
Imports
System.Data.OleDb
Partial Class paket
Inherits
System.Web.UI.Page
Dim transaksi As OleDbConnection
Dim constring As String = ConfigurationManager.ConnectionStrings("cobalagiConnectionString").ConnectionString
Dim oConn As New OleDbConnection(constring)
'Dim oTbl As New DataTable
Dim xReader As OleDbDataReader
Dim Sql As String
Protected Sub
Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Response.Redirect("dbpaket.aspx")
End Sub
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
End Sub
Protected Sub
Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Dim sql As String = "INSERT INTO paketcucisteam VALUES ('" & TextBox1.Text & "','" &
TextBox2.Text & "','" & TextBox3.Text & "');"
Dim oCmd As New OleDbCommand
oConn.Open()
oCmd.Connection = oConn
oCmd.CommandText = sql
oCmd.ExecuteNonQuery()
End Sub
Protected Sub
Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
If Not Len(TextBox2.Text)
= 0 Then
oConn.Close()
oConn.Open()
Dim ocmd As New OleDbCommand("SELECT * FROM paketcucisteam where
namapaket='" + TextBox2.Text + "'", oConn)
xReader
= ocmd.ExecuteReader
If xReader.HasRows Then
xReader.Read()
TextBox1.Text = xReader("codepaket")
TextBox3.Text = xReader("harga")
Else
TextBox1.Text = "Nama paket
Tidak ada"
Exit Sub
End If
xReader.Close()
End If
End Sub
Protected Sub
Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
Dim sql As String = "DELETE FROM paketcucisteam where
namapaket=('" & TextBox2.Text & "');"
Dim oCmd As New OleDbCommand
oConn.Open()
oCmd.Connection = oConn
oCmd.CommandText = sql
oCmd.ExecuteNonQuery()
End Sub
End Class
flow chart