virtualakademik

Contoh Pastebin

Jul 31st, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
  2.         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
  3.             MsgBox("Data belum lengkap")
  4.             TextBox1.Focus()
  5.             Exit Sub
  6.         Else
  7.             cmd = New OleDbCommand("select * from tb_nilai where nim='" & TextBox1.Text & "'", conn)
  8.             rd = cmd.ExecuteReader
  9.             rd.Read()
  10.             If Not rd.HasRows Then
  11.                 Dim simpan As String = "insert into tb_nilai(nim,nama,mata_kuliah,jenjang,jurusan,hadir,tugas,uts,uas,akhir,mutu,keterangan) values " &
  12.                     "('" & TextBox1.Text & "','" & TextBox2.Text & "','" & ComboBox1.Text & "','" & ComboBox2.Text & "','" & ComboBox3.Text & "','" & TextBox3.Text & "','" & TextBox4.Text & "','" & TextBox5.Text & "','" & TextBox6.Text & "','" & TextBox7.Text & "','" & Label11.Text & "','" & Label12.Text & "')"
  13.                 cmd = New OleDbCommand(simpan, conn)
  14.                 cmd.ExecuteNonQuery()
  15.                 MsgBox("simpan data sukses", MsgBoxStyle.Information, "Perhatian")
  16.             End If
  17.             Call tampildata()
  18.             Call kosong()
  19.             TextBox1.Focus()
  20.         End If
  21.     End Sub
Advertisement
Add Comment
Please, Sign In to add comment