dimanche 21 février 2016

Basic4Android SQLITE LIKE Statement

I've been stuck with this since this morning, I'm trying to search on the database table using LIKE statement but I'm getting trouble at where to put the % sign. I already tried different approach but It's not working.

At first I tried the

Dim cur As Cursor
cur = Main.SQL1.ExecQuery2("SELECT * from tbl_info WHERE info_name LIKE  '%?%' ",Array As String(searchString))

But that does not work then I also tried this

Dim cur As Cursor
cur = Main.SQL1.ExecQuery2("SELECT * from tbl_info WHERE info_name LIKE  '"+searchString+"' ",Array As String(searchString))

But I'm getting numberformat exception even though the searchString contains Strings.

Aucun commentaire:

Enregistrer un commentaire