System.Data.SQLite
View Ticket
Not logged in
Ticket UUID: b400a24aab4a529e80cabf6cdf815d8d6c9eadea
Title: How to use REGEXP extension...
Status: Closed Type: Incident
Severity: Important Priority: Medium
Subsystem: Connection Resolution: Works_As_Designed
Last Modified: 2019-08-14 07:41:23
Version Found In: 1.0.111.0
User Comments:
anonymous added on 2019-08-08 09:46:28:
Hello,
The REGEXP command is not recognized from my PC-VB.NET application with nuget System.data.SQLite, even in the latest version 1.0.111
Do you have a solution ?
Thank you
JP MATON, Belgium

ex : 
...
OpenDataBase()
sqlite_cmd.CommandText = "SELECT title FROM Books WHERE comment REGEXP '[^ ]\?'"       ' ne marche pas via VB NET
sqlite_cmd.ExecuteNonQuery()
sqlite_cmd.Dispose()
sqlite_conn.Close()
...

mistachkin added on 2019-08-10 23:34:50:

In order to use the REGEXP extension, it must be enabled first (i.e. since it is an extension). The following C# code snippet shows roughly what is required:

  using (SQLiteConnection conn = new SQLiteConnection())
  {
      conn.ConnectionString = "Data Source=:memory:;";
      conn.Open();
      conn.EnableExtensions(true);
      conn.LoadExtension("SQLite.Interop.dll", "sqlite3_regexp_init");

      //
      // Further code here...
      //
  }


anonymous added on 2019-08-14 07:41:23:
Thank you very much.