Author: minhnguyenhuynh | Posted on: 2/3/2009 4:53:00 PM | Views : 426

When I do the insert, I can pass the error by using Replace function  ' with "
But when I need to compare if it is already in the database, how can I do it? i cannot use replace function no more since when it is written down to database, it is single quote but if i do replace, it's always new to the database so it keep adding new record! Following is my code:
 
Private Function GetAuthorID(ByVal lastname As String, ByVal firstname As String) As String

Dim tmpDSAuthor As New DataSet
Dim tmpAuthourSQL As String = "Select AuthorID, Lastname, Firstname from Author WHERE Lastname like '" & lastname & "' AND Firstname lik ...

Go to the complete details ...