Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub pindah_data()
- Dim SQLiteCon As New SQLiteConnection(DB_Path)
- Try
- SQLiteCon.Open()
- Catch ex As Exception
- SQLiteCon.Dispose()
- SQLiteCon = Nothing
- MsgBox(ex.Message)
- Exit Sub
- End Try
- Try
- Dim sql1 As String = "Select tNik from tbTester where tanggal = '2020-03-09' "
- Dim cmd1 As SQLiteCommand = New SQLiteCommand(sql1, SQLiteCon)
- Using reader As SQLiteDataReader = cmd1.ExecuteReader()
- If reader.HasRows Then
- MsgBox("User already exist", MsgBoxStyle.Exclamation, "add new data.!")
- Else
- Dim cmd As SQLiteCommand = New SQLiteCommand("Insert tS1 (tNik, tNama, tDivisi, tSenin, tTanggal, tShift) SELECT NIK, Nama, Divisi, Status, Tanggal, Shift FROM tbESD_Tester WHERE Tanggal = '2020-03-09' and shift = '1' ", SQLiteCon)
- cmd.ExecuteNonQuery()
- MsgBox("Success", MsgBoxStyle.Information, "Add new data success")
- End If
- End Using
- Catch ex As Exception
- End Try
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement