8

I'm trying to build a search query to match whole words in SQLite and C# on Windows. When I run a query like this:

SELECT a, b FROM Events WHERE c REGEXP @SearchString;

Then:

cmd.Parameters.Add(new SQLiteParameter("@SearchString", 
"%[^a-zA-Z0-9]" + searchdata.SearchText + "[^a-zA-Z0-9]%"));

And when I call:

var r = cmd.ExecuteReader();

I get REGEXP no such function. I wonder how to activate REGEXP support and CASE SENSITIVE search.

2
  • Did you read this question and the answer from mivk? Commented Dec 16, 2013 at 22:57
  • Yes, but I'm on Windows and I cannot find a link to fix it. Commented Dec 17, 2013 at 0:53

2 Answers 2

5

I've got it! The problem was that I didn't define the REGEXP function. I've got from here: here a definition for C#.

Sign up to request clarification or add additional context in comments.

Comments

0

You shouldn't need the %. That is only for LIKE.

5 Comments

The same error. The problem is the REGEXP not the parameter format. I think Konrad is correct to point me that something is missing but what?
@PabloYabo what version of sqlite are you using?
I'm using SQLite.NET 1.0.88.0 - August 7, 2013. SQLite 3.7.17
@PabloYabo ensure that it is in your build of sqlite.
How I should do that?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.