2017-07-13 92 views

回答

0

您將需要添加在你的Android項目SQLite的包的NuGet,並添加了命名空間到文件。

SQLite.Net.Platform.XamarinAndroid 
0

在所有項目中添加SQLite.Net-PCL

public SQLiteConnection GetConnection() 
    { 
     var sqliteFilename = "Test.db3"; 
     string documentsPath = 
     System.Environment.GetFolderPath(System.Environment. 
     SpecialFolder.Personal); 
     // Documents folder 
     var path = Path.Combine(documentsPath, sqliteFilename); 
     var plat = new 
     SQLite.Net.Platform.XamarinAndroid.SQLitePlatformAndroid(); 
     var conn = new SQLiteConnection(plat, path); 
     // Return the database connection 
     return conn; 
    } 
相關問題