简体   繁体   English

SQLiteConnection,C#

[英]SQLiteConnection, C#

I installed the reference for "SQLite for Universal App Platform" in my Visual Studio 2015 project, later I installed the NuGet package "sqlite.net-pcl-silverlight" 我在Visual Studio 2015项目中安装了“ SQLite for Universal App Platform”的引用,后来又安装了NuGet包“ sqlite.net-pcl-silverlight”

I am trying the following lines: 我正在尝试以下几行:

string dbPath = Path.Combine(ApplicationData.Current.LocalFolder.Path, "Storage.sqlite"); 
SQLiteConnection DB = new SQLiteConnection(dbPath); 

It doesn't work but I found that this line is valid: 它不起作用,但是我发现这行是有效的:

SQLiteConnection DB = new SQLiteConnection(sqlitePlatform, dbPath); 

My problem is that I don't know which should be the value of sqlitePlatform... Please help. 我的问题是我不知道sqlitePlatform的值是什么...请帮助。

For UWP the same sqlitePlatform as WinRT should work. 对于UWP,应该使用与WinRT相同的sqlitePlatform Go ahead and try this: 继续尝试以下操作:

var connection = new SQLiteConnection(new SQLite.Net.Platform.WinRT.SQLitePlatformWinRT(), path);

That should work for you. 那应该为您工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM