Problem with LIKE in a SELECT statement...

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.
 
C

Cor Ligthert

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top