Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
- If TextBox1.Text = "" Or TextBox2.Text = "" Or TextBox3.Text = "" Or TextBox4.Text = "" Or TextBox5.Text = "" Or TextBox6.Text = "" Or ComboBox1.Text = "" Or ComboBox2.Text = "" Or ComboBox3.Text = "" Then
- MsgBox("Data belum lengkap")
- TextBox1.Focus()
- Exit Sub
- Else
- cmd = New OleDbCommand("select * from tb_nilai where nim='" & TextBox1.Text & "'", conn)
- rd = cmd.ExecuteReader
- rd.Read()
- If Not rd.HasRows Then
- Dim simpan As String = "insert into tb_nilai(nim,nama,mata_kuliah,jenjang,jurusan,hadir,tugas,uts,uas,akhir,mutu,keterangan) values " &
- "('" & TextBox1.Text & "','" & TextBox2.Text & "','" & ComboBox1.Text & "','" & ComboBox2.Text & "','" & ComboBox3.Text & "','" & TextBox3.Text & "','" & TextBox4.Text & "','" & TextBox5.Text & "','" & TextBox6.Text & "','" & TextBox7.Text & "','" & Label11.Text & "','" & Label12.Text & "')"
- cmd = New OleDbCommand(simpan, conn)
- cmd.ExecuteNonQuery()
- MsgBox("simpan data sukses", MsgBoxStyle.Information, "Perhatian")
- End If
- Call tampildata()
- Call kosong()
- TextBox1.Focus()
- End If
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment