The Reptilian Army
The Reptilian Army

Reputation: 478

Xamarin SQLite How can i get values from my database to use them in my code?

Im working on visual studio 2015 with Xamarin and SQLite and i was trying to get values from my database so i could save them in variables in my code how can i do this?

My Code:

string folder = "/sdcard/Pictures/";
            var db = new SQLiteConnection(System.IO.Path.Combine(folder, "GameHubDB.db"));

            db.CreateCommand("SELECT Id FROM [Note] WHERE Username = '" + UsernameTxt.Text + "' AND Password='" + PasswordTxt.Text + "'", Id);
            db.Commit();

Upvotes: 1

Views: 476

Answers (1)

Akash Amin
Akash Amin

Reputation: 2761

You can use a nuget package to create the SQLite connection. Refer this link https://developer.xamarin.com/recipes/android/data/databases/sqlite/

Upvotes: 1

Related Questions