Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Access Query Syntax
Message
From
20/10/2005 00:42:05
 
General information
Forum:
ASP.NET
Category:
Databases
Miscellaneous
Thread ID:
01060601
Message ID:
01060609
Views:
12
You're probably just missing the single quotes around your search value.

~~Bonnie



>Whats the correct syntax for pulling data from SQL using 'LIKE'?
>
>
>This does not work
>
>
>sTextVal = txtText.Text.Trim()
>
>sSQLCommand = " select " & sSearchField & _
>  " from " & sSearchAlias & _
>  " where " & sSearchField & " like " & _
>  sTextVal & "%"
>
>
>
>
>
>This works fine
>
>
>sTextVal = txtText.Text.Trim()
>
>sSQLCommand = " select " & sSearchField & _
>  " from " & sSearchAlias & _
>  " where " & sSearchField & " = 'Electronic'"
>
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Reply
Map
View

Click here to load this message in the networking platform