[英]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?我使用 Xamarin 和 SQLite 在 Visual Studio 2015 上工作,我试图从我的数据库中获取值,以便我可以将它们保存在我的代码中的变量中,我该怎么做?
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();
You can use a nuget package to create the SQLite connection.您可以使用 nuget 包来创建 SQLite 连接。 Refer this link https://developer.xamarin.com/recipes/android/data/databases/sqlite/请参阅此链接https://developer.xamarin.com/recipes/android/data/databases/sqlite/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.