I'm following this guide to do a custom query with params using SQLite at Xamarin iOS app:
select * from [Contact] where FirstName = 'Alex'
When I query it using plain string it works fine:
_db.Query<Contact>("select * from [Contact] where FirstName = 'Alex'").ToList();
but I want to execute it using params to avoid injections:
_db.Query<Contact>("select * from [Contact] where FirstName = '?'", "Alex").ToList();
Trace: Executing Query: select * from [Contact] where FirstName = '?' 0: First1
Unfortunately it returns 0 results (while initial query returns the required data).
Aucun commentaire:
Enregistrer un commentaire