Assalamualaikum wr.wb
Pada kesempatan kali ini saya akan memposting tugas UAS mata kuliah BASIS DATA II dengan judul Project Web Form Normalisasi Data dengan ASP.Net VB dan Database SQL Server 2014 dari Struk Pembayaran SPP kuliah via Bank.
Berikut ini saya lampirkan bukti asli dari struk pembayaran SPP yang saya gunakan untuk project normalisasi data ini.
2. Bentuk Tidak Normal (UnNormalized)
dari bentuk tidak normal berikutnya kita rubah kedalam bentuk normal ke-1 atau 1NF
3. Bentuk 1NF
Suatu relasi yang disebut memenuhi bentuk normal pertama (1NF) jika setiap atribut dari relasi tersebut hanya memiliki satu nilai dan tidak ada nilai yang berulangan grup atribut dalam baris.
Setelah itu kita rubah kembali kedalam bentuk normal ke-2 atau 2NF
4. Bentuk 2NF
Untuk membentuk normal kedua harus ditentukan kunci-kunci dalam setiap field suatu form tersebut, dan kunci field harus unik dan bisa menjadi wakil untuk atributte lain yang menjadi anggota lainnya.
Setelah itu lanjut normalisasi bentuk ke-3 atau 3NF
5. Bentuk 3NF
Normalisasi data dalam bentuk ketiga bertujuan untuk menghilangkan seluruh atribut atau field yang sama sekali tidak berhubungan dengan primary key.
Setelah itu kita buat query atau relasinya.
6. Relasi Table
Relasi Table |
Setelah tahap normalisasi selesai selanjutnya kita buat form dengan Web Form ASP.Net VB di visual Studio. Berikut Ini tampilan dari Web Form ASP.Net VB yang telah saya buat.
1. Form Input Data
Web Form |
2. Form View Data
Imports System.Data
Imports System.Data.SqlClient
Public Class WebForm1
Inherits System.Web.UI.Page
Dim Conn As SqlConnection
Dim Da As SqlDataAdapter
Dim Ds As DataSet
Dim Cmd As SqlCommand
Dim RD As SqlDataReader
Dim LokasiDB As String
Sub Koneksi()
LokasiDB = "data source=DESKTOP-1B9QNLA;initial catalog=DB_IKWAN-161021450062;integrated security =true"
Conn = New SqlConnection(LokasiDB)
If Conn.State = ConnectionState.Closed Then Conn.Open()
End Sub
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 Button1.Click
Call Koneksi()
Dim simpan As String = "insert into Faktur values ('" & TextBox1.Text & "','" & TextBox2.Text & "','" & TextBox3.Text & "', '" & DropDownList1.Text & "','" & TextBox4.Text & "','" & DropDownList2.Text & "','" & TextBox6.Text & "','" & DropDownList3.Text & "','" & TextBox7.Text & "')"
Cmd = New SqlCommand(simpan, Conn)
Cmd.ExecuteNonQuery()
MsgBox("Input data berhasil")
End Sub
Protected Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox6.Text = ""
TextBox7.Text = ""
DropDownList1.Text = ""
DropDownList2.Text = ""
End Sub
Protected Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
Response.Redirect("Database.aspx")
End Sub
Protected Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
Call Koneksi()
Dim delete As String = "delete from Faktur where NomorTagihan = '" & TextBox3.Text & "'"
Cmd = New SqlCommand(delete, Conn)
Cmd.ExecuteNonQuery()
Conn.Close()
MsgBox("Data Telah Dihapus")
Response.Redirect("Database.aspx")
End Sub
Protected Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click
Call Koneksi()
Dim search As String = "select * from Faktur where NomorTagihan like '%" & TextBox3.Text & "'"
Cmd = New SqlCommand(search, Conn)
Dim xReader As SqlDataReader
xReader = Cmd.ExecuteReader()
If xReader.HasRows Then
xReader.Read()
TextBox1.Text = xReader("WaktuTransaksi")
TextBox2.Text = xReader("KodeReferensi")
TextBox3.Text = xReader("NomorTagihan")
DropDownList1.Text = xReader("NamaTagihan")
TextBox4.Text = xReader("TotalTagihan")
DropDownList2.Text = xReader("KodeReferensi")
TextBox6.Text = xReader("NamaMahasiswa")
DropDownList3.Text = xReader("NamaProdi")
TextBox7.Text = xReader("UserIDTeller")
Button2.Enabled = True
Else
MsgBox("Data Tidak Ditemukan!!!")
Exit Sub
End If
Conn.Close()
End Sub
Protected Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Call Koneksi()
Dim cari As String = "update Faktur set WaktuTransaksi = '" + TextBox1.Text + "' where NomorTagihan='" + TextBox3.Text + "'"
Cmd = New SqlCommand(cari, Conn)
Cmd.ExecuteNonQuery()
Conn.Close()
End Sub
Protected Sub Exit_Click(sender As Object, e As EventArgs) Handles [Exit].Click
FileClose()
End Sub
End Class
Imports System.Data.SqlClient
Public Class WebForm1
Inherits System.Web.UI.Page
Dim Conn As SqlConnection
Dim Da As SqlDataAdapter
Dim Ds As DataSet
Dim Cmd As SqlCommand
Dim RD As SqlDataReader
Dim LokasiDB As String
Sub Koneksi()
LokasiDB = "data source=DESKTOP-1B9QNLA;initial catalog=DB_IKWAN-161021450062;integrated security =true"
Conn = New SqlConnection(LokasiDB)
If Conn.State = ConnectionState.Closed Then Conn.Open()
End Sub
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 Button1.Click
Call Koneksi()
Dim simpan As String = "insert into Faktur values ('" & TextBox1.Text & "','" & TextBox2.Text & "','" & TextBox3.Text & "', '" & DropDownList1.Text & "','" & TextBox4.Text & "','" & DropDownList2.Text & "','" & TextBox6.Text & "','" & DropDownList3.Text & "','" & TextBox7.Text & "')"
Cmd = New SqlCommand(simpan, Conn)
Cmd.ExecuteNonQuery()
MsgBox("Input data berhasil")
End Sub
Protected Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox6.Text = ""
TextBox7.Text = ""
DropDownList1.Text = ""
DropDownList2.Text = ""
End Sub
Protected Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
Response.Redirect("Database.aspx")
End Sub
Protected Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
Call Koneksi()
Dim delete As String = "delete from Faktur where NomorTagihan = '" & TextBox3.Text & "'"
Cmd = New SqlCommand(delete, Conn)
Cmd.ExecuteNonQuery()
Conn.Close()
MsgBox("Data Telah Dihapus")
Response.Redirect("Database.aspx")
End Sub
Protected Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click
Call Koneksi()
Dim search As String = "select * from Faktur where NomorTagihan like '%" & TextBox3.Text & "'"
Cmd = New SqlCommand(search, Conn)
Dim xReader As SqlDataReader
xReader = Cmd.ExecuteReader()
If xReader.HasRows Then
xReader.Read()
TextBox1.Text = xReader("WaktuTransaksi")
TextBox2.Text = xReader("KodeReferensi")
TextBox3.Text = xReader("NomorTagihan")
DropDownList1.Text = xReader("NamaTagihan")
TextBox4.Text = xReader("TotalTagihan")
DropDownList2.Text = xReader("KodeReferensi")
TextBox6.Text = xReader("NamaMahasiswa")
DropDownList3.Text = xReader("NamaProdi")
TextBox7.Text = xReader("UserIDTeller")
Button2.Enabled = True
Else
MsgBox("Data Tidak Ditemukan!!!")
Exit Sub
End If
Conn.Close()
End Sub
Protected Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Call Koneksi()
Dim cari As String = "update Faktur set WaktuTransaksi = '" + TextBox1.Text + "' where NomorTagihan='" + TextBox3.Text + "'"
Cmd = New SqlCommand(cari, Conn)
Cmd.ExecuteNonQuery()
Conn.Close()
End Sub
Protected Sub Exit_Click(sender As Object, e As EventArgs) Handles [Exit].Click
FileClose()
End Sub
End Class
Sekian laporan normalisasi data saya, mohon maaf atas segala kekuranganya. Wassalamualaikum wr.wb Salam Super :)
0 comments:
Post a Comment