Home All Groups Group Topic Archive Search About

Select in with like - ado.net

Author
7 Jan 2006 8:25 AM
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

Author
7 Jan 2006 8:28 AM
Armin Zingler
"JR" <XX***@XX.XX> schrieb
> 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
Author
7 Jan 2006 9:15 AM
Cor Ligthert [MVP]
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

Show quoteHide quote
"JR" <XX***@XX.XX> schreef in bericht
news:UVKvf.90440$V%7.5969034@phobos.telenet-ops.be...
> 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
>
Author
7 Jan 2006 1:46 PM
JR
the controls are oleDB with access database


Show quoteHide quote
"Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> schreef in bericht
news:OpvrQr2EGHA.1424@TK2MSFTNGP12.phx.gbl...
> 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
>
> "JR" <XX***@XX.XX> schreef in bericht
> news:UVKvf.90440$V%7.5969034@phobos.telenet-ops.be...
>> 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
>>
>
>
Author
8 Jan 2006 2:26 PM
Dennis
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.
--
Dennis in Houston


Show quoteHide quote
"JR" wrote:

> the controls are oleDB with access database
>
>
> "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> schreef in bericht
> news:OpvrQr2EGHA.1424@TK2MSFTNGP12.phx.gbl...
> > 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
> >
> > "JR" <XX***@XX.XX> schreef in bericht
> > news:UVKvf.90440$V%7.5969034@phobos.telenet-ops.be...
> >> 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
> >>
> >
> >
>
>
>