Advertisement
Guest User

Untitled

a guest
Aug 11th, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. strSQL = "SELECT * FROM tblLogin WHERE IDLogin ='" & txtIDLogin.Text & "'"
  2. com = New MySql.Data.MySqlClient.MySqlCommand(strSQL, conn)
  3. rd = com.ExecuteReader()
  4. rd.Read()
  5. If rd.HasRows Then
  6. Call konek()
  7. strSQL = "Update tblLogin set Username = '" & txtUsername.Text & _
  8. "', Password = '" & txtPassword.Text & _
  9. "', Status = '" & cboStatus.Text & _
  10. "' where IDLogin = '" & txtIDLogin.Text & "'"
  11. com = New MySql.Data.MySqlClient.MySqlCommand(strSQL, conn)
  12. com.ExecuteNonQuery()
  13. Else
  14. Call konek()
  15. strSQL = "INSERT INTO tblLogin VALUES ('" & _
  16. txtIDLogin.Text & "','" & txtUsername.Text & "','" & _
  17. txtPassword.Text & "','" & cboStatus.Text & "')"
  18. com = New MySql.Data.MySqlClient.MySqlCommand(strSQL, conn)
  19. com.ExecuteNonQuery()
  20. End If
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement