Aplikasi Pendaftaran SMK VB .NET
Aplikasi Pendaftaran SMK VB .NET - Kali ini saya membuat tutorial cara membuat aplikasi pendaftaran SMK dengan database .langsung saja
1. Buat Database dengan seperti di gambar
1. Buat Database dengan seperti di gambar
2. Buat form dengan tampilan seperti di gambar
3. Script
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'Database12DataSet.Pendaftaran' table. You can move, or remove it, as needed.
Me.PendaftaranTableAdapter.Fill(Me.Database12DataSet.Pendaftaran)
For a = 2020 To 2000 Step -1
ComboBox4.Items.Add(a)
Next
DateTimePicker1.Enabled = False
TextBox2.Enabled = False
TextBox1.Enabled = False
ComboBox1.Enabled = False
TextBox3.Enabled = False
DateTimePicker2.Enabled = False
RichTextBox1.Enabled = False
ComboBox2.Enabled = False
TextBox4.Enabled = False
RichTextBox2.Enabled = False
ComboBox4.Enabled = False
TextBox6.Enabled = False
ComboBox3.Enabled = False
TextBox7.Enabled = False
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
DateTimePicker1.Enabled = True
TextBox2.Enabled = True
TextBox1.Enabled = True
ComboBox1.Enabled = True
TextBox3.Enabled = True
DateTimePicker2.Enabled = True
RichTextBox1.Enabled = True
ComboBox2.Enabled = True
TextBox4.Enabled = True
RichTextBox2.Enabled = True
ComboBox4.Enabled = True
TextBox6.Enabled = True
ComboBox3.Enabled = True
TextBox7.Enabled = True
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Try
Dim simpan As Database12DataSet.PendaftaranRow
simpan = Database12DataSet.Pendaftaran.NewPendaftaranRow
simpan.Tanggal = DateTimePicker1.Text
simpan.NISN = TextBox1.Text
simpan.Nama = TextBox2.Text
simpan.Jenis_Kelamin = ComboBox1.Text
simpan.Tempat_Lahir = TextBox3.Text
simpan.Tanggal_Lahir = DateTimePicker2.Text
simpan.Alamat = RichTextBox1.Text
simpan.Agama = ComboBox2.Text
simpan.Nama_Sekolah = TextBox4.Text
simpan.Alamat_Sekolah = RichTextBox2.Text
simpan.No = TextBox6.Text
simpan.Bidang = ComboBox3.Text
simpan.No_hp = TextBox7.Text
Database12DataSet.Pendaftaran.Rows.Add(simpan)
Me.PendaftaranTableAdapter.Update(Database12DataSet)
Me.PendaftaranBindingSource.EndEdit()
MsgBox("Tersimpan")
Catch ex As Exception
End Try
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Try
Me.PendaftaranBindingSource.EndEdit()
Me.PendaftaranTableAdapter.Update(Me.Database12DataSet.Pendaftaran)
MsgBox("Data Berhasil Diedit")
Catch ex As Exception
MsgBox("Data Gagal Diedit")
End Try
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Try
PendaftaranBindingSource.RemoveCurrent()
MsgBox("Data Berhasil Duhapus")
Catch ex As Exception
MsgBox("Data Gagal Dihapus")
End Try
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
Dim x As String = MsgBox("Keluar??", MsgBoxStyle.YesNo + MsgBoxStyle.Question, "Konfirmasi")
If x = vbYes Then
Me.Close()
End If
End Sub
End Class
4. Hasil
Sebelum menginput data kita add new --> lalu kita input ----> lalu save ,maka data akan masuk pada kotak database
Sekian semoga bermanfaat---------------------------------------------------------
NB : Jika perlu bantuan hubungi email nikoaditya6@gmail.com
=
No comments: