Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

SQLITE Commands C#/Android

$
0
0

Hey, I just started working with a tutorial and everything works but it douse not talk about the basics of Insert, Delete, Update in a database.
Question:
How do you display everything in a database ?

These are the commands I know that work :
Count:
var count = db.ExecuteScalar ("SELECT Count(*) FROM Person");
Inserting:
var result = insertUpdateData (new Person {
FirstName = string.Format ("John {0}", DateTime.Now.Ticks),
LastName = "Smith"
}, pathToDatabase);

Create Database:connection.CreateTable<Person> ();

View all from table:
??? NB: I know I'm suppose too use ExecuteReaderbut Xamarin douse not have that in its library

Delete Record :
Not working - > I get a null exception
var count = db.ExecuteScalar<int> (@"DELETE FROM Person WHERE FirstName = 'Amy'");

Would be great if I could get these basic functions working... Have been trying for days


Viewing all articles
Browse latest Browse all 58056

Trending Articles



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