Problem with LIKE in a SELECT statement...

  • Thread starter Thread starter Manuel Canas
  • Start date Start date
M

Manuel Canas

Hi there,

This is the code that I'm trying to build to retrieve data from the
database.

strSQL = "SELECT RTRIM(LastName) + ', ' + FirstName AS FullName, PatientID
FROM tb_Patient " & _

"WHERE LastName LIKE @PatientSearch"

cmSQL = New SqlCommand(strSQL, cnSQL)

cmSQL.Parameters.Add("@PatientSearch", SqlDbType.Char).Value =
txtPatientSearch.Text

I'm trying to pass the value of the txtPatientSearch s a parameter into the
SELECT Statement. I'm not getting any luck, it seems that nothing is getting
passed with @PatientSearch Parameter.



Anyone out there that knows how to properly set this up?

Thanks very much,

Manny.
 
What is the sense of that, suggest a crossposting, that is the best for the
OP.
 
Back
Top