简体   繁体   English

Xamarin SQLite 如何从我的数据库中获取值以在我的代码中使用它们?

[英]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.

相关问题 如何更新我的sqlite数据库中的值? - How can I update the values in my sqlite database? 如何在PC中制作Sqlite数据库以在我的应用程序中使用? - How I can make a Sqlite Database in PC for use in my app? 如何根据来自板载SQLite数据库的数据对ListView使用不同的布局? - How can I use different layouts with my ListView depending on data coming from the on-board SQLite database? 如何在计算机上找到我的SQLite数据库文件? - How can I find my SQLite database file on my computer? 如何在Eclipse中检查我的SQLite数据库值? - How do i check my SQLite database values in eclipse? 如何在string.xml中为微调项分配整数值并在代码中读取它们? - How can I assign integer values to spinner items in strings.xml and read them in my code? 如何在 firebase 数据库中的文本中显示我的数据实时我的代码和我的 XML 在 - How can I show my data in text from firebase database Realtime my code and my XML is in 我可以从 Flutter 导出我的 sqlite 数据库吗? - Can I export my sqlite database from Flutter? 我无法从Android SQLite数据库中删除行 - I can't delete a row from my Android SQLite database 如何在项目中使用使用sqlite创建的数据库? - How do i use the database created using sqlite in my project?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM