Results 1 to 1 of 1
11-18-12, 18:30 #1Registered User
- Join Date
- Jul 2004
Unanswered: Using LIKE '%variable%' with a parameterized query
I am trying to accomplish something like...
SELECT ItemID, ItemNumber, ItemDesc FROM ITEMS WHERE ItemDesc LIKE '%variable%'
The problem is I am using a parameterized query, so it is structure like...
rsItems_cmd.CommandText = "SELECT ItemID, ItemNumber, ItemDesc FROM ITEMS WHERE ItemDesc LIKE ?"
and then passing the parameter...
rsItems_cmd.Parameters.Append rsItems_cmd.CreateParameter("param1", 200, 1, 50, rsItems__Variable
(Where rsItems__Variable is a string of the value passed)
How do I use a LIKE command when passing a text string as a parameter??