LIKE Parameter Queries Table Adapter fails?

  • Thread starter Thread starter RB
  • Start date Start date
R

RB

How can the following be revised to work in Queries table adpater?

SELECT CustomerID, CompanyName
FROM Customers
WHERE (PostalCode LIKE @PARAM1 + '%')

Error message using Query Builder is:

"Error Source: SQL Server Compact Edition ADO.NET Data Provider"
"Error Message: Data Conversion Failed. [OLE Db Status value (if known) =2]

Same error if
WHERE (PostalCode Like '%' + @PARAM1 + '%')

I want to use the left 3 or 4 digits of a zip code to narrow a customer
list. Seems lke a common problem.

Thanks in advance,

RB
 
How about this:



WHERE (PostalCode LIKE @PARAM1)



Then add % as need to the parameter's value.





--
Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.

*** Want to find answers instantly? Here's how... ***

1. Go to
http://groups-beta.google.com/group/microsoft.public.dotnet.framework.compactframework?hl=en
2. Type your question in the text box near "Search this group" button.
3. Hit "Search this group" button.
4. Read answer(s).
 
Back
Top