Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

How can i query sqlite3 with characters: íáéú?

$
0
0

Hey,
I'm using the sqlite3 .net wrapper
http://components.xamarin.com/view/sqlite-net

Now i have no problem setting um my db and querying it with normal characters. But as soon as i type in the special ones,
e.g. "Dúfnahó", my app crashes on the second character.

        string query = "select * from Position where Descr like '" + search + "%';";
        return me.db.Query<Position>(query);  

Tried various things but i'm having trouble finding documentation for this Component.
The error message goes like this:

An unhandled exception occured.
12-27 16:10:29.529 I/MonoDroid(14097): UNHANDLED EXCEPTION: MiniV.DL.SQLite.SQLiteException: unrecognized token: "'dúfnahí%"
12-27 16:10:29.529 I/MonoDroid(14097): at MiniV.DL.SQLite.SQLite3.Prepare2 (intptr,string) [0x0001f] in c:\TFSSRC\APPLICON\Vigor\VBS\MiniVBS\Trunk\MiniVigor\MiniVigor.Core\DL\SQLite.cs:1676
12-27 16:10:29.529 I/MonoDroid(14097): at MiniV.DL.SQLite.SQLiteCommand.Prepare () [0x00001] in c:\TFSSRC\APPLICON\Vigor\VBS\MiniVBS\Trunk\MiniVigor\MiniVigor.Core\DL\SQLite.cs:1095
12-27 16:10:29.529 I/MonoDroid(14097): at MiniV.DL.SQLite.SQLiteCommand/<ExecuteDeferredQuery>d__0`1<MiniV.BL.Position>.MoveNext () <0x002a3>
12-27 16:10:29.529 I/MonoDroid(14097): at System.Collections.Generic.List`1<MiniV.BL.Position>.AddEnumerable (System.Collections.Generic.IEnumerable`1<MiniV.BL.Position>) <0x0018f>
12-27 16:10:29.529 I/MonoDroid(14097): at System.Collections.Generic.List`1<MiniV.BL.Position>..ctor (System.Collections.Generic.IEnumerable`1<MiniV.BL.Position>) <0x0015b>
12-27 16:10:29.529 I/MonoDroid(14097): at System.Linq.Enumerable.ToList<MiniV.BL.Position> (System.Collections.Generic.IEnumerable`1<MiniV.BL.Position>) <0x00077>
12-27 16:10:29.529 I/MonoDroid(14097): at MiniV.DL.SQLite.SQLiteCommand.ExecuteQuery<MiniV.BL.Position> () <0x000df>
12-27 16:10:29.529 I/MonoDroid(14097): at MiniV.DL.SQLite.SQLiteConnection.Query<MiniV.BL.Position> (string,object[]) <0x000bf>
12-27 16:10:29.529 I/MonoDroid(14097): at MiniV.DAL.PositionRepository.GetFilteredPosition (string) [0x00019] in c:\TFSSRC\APPLICON\Vigor\VBS\MiniVBS\Trunk\MiniVigor\MiniVigor.Core\DAL\PositionRepository.cs:79
12-27 16:10:29.529 I/MonoDroid(14097): at MiniV.BL.Managers.PositionManager.getPositions (string) [0x00001] in c:\TFSSRC\APPLICON\Vigor\VBS\MiniVBS\Trunk\MiniVigor\MiniVigor.Core\BL\Managers\PositionManager.cs:25
12-27 16:10:29.529 I/MonoDroid(14097): at MiniVigor.HomeActivity.OnTextChange (object,System.EventArgs) [0x00001] in c:\TFSSRC\APPLICON\Vigor\VBS\MiniVBS\Trunk\MiniVigor\MiniVigor\HomeActivity.cs:127
12-27 16:10:29.529 I/MonoDroid(14097): at Android.Text.TextWatcherImplementor.Android.Text.ITextWatcher.OnTextChanged (Java.Lang.ICharSequence,int,int,int) [0x0000d] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.10.1-branch/d23a19bf/source/monodroid/src/Mono.Android/src/Android.Text/ITextWatcher.cs:91
12-27 16:10:29.529 I/MonoDroid(14097): at Android.Text.ITextWatcherInvoker.n_OnTextChanged_Ljava_lang_CharSequence_III (intptr,intptr,intptr,int,int,int) [0x00011] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.10.1-branch/d23a19bf/source/monodroid/src/Mono.Android/platforms/android-17/src/generated/Android.Text.ITextWatcher.cs:149
12-27 16:10:29.529 I/MonoDroid(14097): at (wrapper dynamic-method) object.00cee5db-bcb0-412e-97ae-f4a1043ea9ec (intptr,intptr,intptr,int,int,int) <IL 0x00029, 0x0007b>
Unhandled Exception:  

MiniV.DL.SQLite.SQLiteException: unrecognized token: "'dúfnahí%"
12-27 16:17:50.929 I/dalvikvm(14097): threadid=3: reacting to signal 3
12-27 16:17:50.999 I/dalvikvm(14097): Wrote stack traces to '/data/anr/traces.txt'
The program 'Mono' has exited with code 0 (0x0).  

All ideas appreciated!


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>