Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Imports MySql.Data.MySqlClient
Imports System.Data.Sql
End Sub
Sub tampil()
da = New MySqlDataAdapter(str, koneksi)
ds = New DataSet
ds.Clear()
da.Fill(ds, "t_siswa")
dgv1.DataSource = ds.Tables(0)
'Mengatur lebar kolom di datagridview
dgv1.Columns(0).Width = 40
dgv1.Columns(1).Width = 100
dgv1.Columns(2).Width = 50
dgv1.Columns(3).Width = 150
'Mengatur header di datagridview
dgv1.Columns(0).HeaderText = "NIS"
dgv1.Columns(1).HeaderText = "NAMA"
dgv1.Columns(2).HeaderText = "KELAS"
dgv1.Columns(3).HeaderText = "KOMPETENSI KEAHLIAN"
End Sub
Sub tampilspp()
da = New MySqlDataAdapter(str2, koneksi)
ds = New DataSet
ds.Clear()
da.Fill(ds, "t_spp")
dgv2.DataSource = ds.Tables(0)
'Mengatur lebar kolom di datagridview
dgv2.Columns(0).Width = 25 'nobayar
dgv2.Columns(1).Width = 50 'nis
dgv2.Columns(2).Width = 70 'nama
dgv2.Columns(3).Width = 65 'kelas
dgv2.Columns(4).Width = 75 'tglbayar
dgv2.Columns(5).Width = 70 'Bulan
dgv2.Columns(6).Width = 70 'nominal
End Sub
Else
MsgBox("kosong")
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
End If
koneksi.Close()
End Sub
tampilspp()
End Sub
str2 = "select * from t_spp where bulan='" & ComboBox1.Text & "' and nis='" &
TextBox1.Text & "' "
cmd = New MySqlCommand(str2, koneksi)
cmd.ExecuteNonQuery()
Else
koneksi.Close()
koneksi.Open()
str2 = "insert into t_spp(nis,tgl,bulan,jspp) values(" & TextBox1.Text &
",'" & Format(DateTimePicker1.Value.Date, "yyyy-MM-dd") & "','" & ComboBox1.Text &
"','" & ComboBox2.Text & "')"
cmd = New MySqlCommand(str2, koneksi)
cmd.ExecuteNonQuery()
MsgBox("Data berhasil ditambahkan")
End If
koneksi.Close()
koneksi.Open()
End Sub