query with like

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for SQLite
Post Reply
micoud
Posts: 4
Joined: Fri 28 Jun 2013 18:53

query with like

Post by micoud » Wed 18 Jun 2014 17:50

why this query generateb by dataset wizard of vs2010 won't work ?
no row at all ... also passing NumeroCig string in total

Code: Select all

SELECT ID, NumeroCig, ImportoIniziale, ImportoSpeso, Data
FROM            CIG
WHERE        (NumeroCig LIKE '%' + :Param1 + '%')
dll version 5.1.80.0

thanks

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: query with like

Post by Pinturiccio » Thu 19 Jun 2014 15:41

You have sent us an invalid query. You can fix it in either of the following ways:
1. String concatenation operator in SQlite is '||' not '+':

Code: Select all

    SELECT ID, NumeroCig, ImportoIniziale, ImportoSpeso, Data
    FROM            CIG
    WHERE        (NumeroCig LIKE '%' || :Param1 || '%')
2. Include the whole condition to the parameter:

Code: Select all

    SELECT ID, NumeroCig, ImportoIniziale, ImportoSpeso, Data
    FROM            CIG
    WHERE        (NumeroCig LIKE :Param1)
Parameter value: "%value%".

micoud
Posts: 4
Joined: Fri 28 Jun 2013 18:53

Re: query with like

Post by micoud » Mon 23 Jun 2014 13:47

thanks :D

Post Reply