Select in with like - ado.net

  • Thread starter Thread starter JR
  • Start date Start date
J

JR

Hi,

can I use wildcards in a select command. My command is like this
SELECT ID FROM songs WHERE (Title LIKE in(?))
if I remove the 'like' or the 'in' it works. together it doesn't

of course without the in I need the correct names and with the like I add
the '%'

thanks Jan
 
JR said:
Hi,

can I use wildcards in a select command. My command is like this
SELECT ID FROM songs WHERE (Title LIKE in(?))
if I remove the 'like' or the 'in' it works. together it doesn't

of course without the in I need the correct names and with the like
I add the '%'


SQL is not part of the VB.Net language. As your subject says, the ADO.Net
group is the best place to ask: microsoft.public.dotnet.framework.adonet


Armin
 
JR,

Be aware that AFAIK SQL has a lot of dialects depending of the used DataBase
Server

If you ask can I use it, than the answer is yes, however how means that you
would have to tell what databaseserver.

One of the best places to ask this is by the way as Armin wrote.

I hope this helps,

Cor
 
the controls are oleDB with access database


Cor Ligthert said:
JR,

Be aware that AFAIK SQL has a lot of dialects depending of the used
DataBase Server

If you ask can I use it, than the answer is yes, however how means that
you would have to tell what databaseserver.

One of the best places to ask this is by the way as Armin wrote.

I hope this helps,

Cor
 
I use the following sql to open a datareader and it works fine:

DBCmd = New OleDb.OleDbCommand("SELECT Name FROM Recipes WHERE _
RecipeName LIKE '%cake'" , DBConn)
RDR = DBCmd.ExecuteReader

Note that %Cake is enclosed in single quotes.
 
Back
Top