mardi 12 janvier 2016

SQLite support for Universal Windows App

I am using Xamarin Forms to develop an app and using SQlite to store the user details. Just started with windows(Windows 10). Does SQLite has support for UWP, I have referred some sites and its saying it does support. but when I am trying, the connection is always null.

The code i am using:

 public SQLite.Net.SQLiteConnection GetConnection()
 {
  var sqliteFilename = "Sample.db3";
  string path = Path.Combin(ApplicationData.Current.LocalFolder.Path, sqliteFilename);
   if (!File.Exists(path))
   {
    File.Create(path + sqliteFilename);
   }
   var plat = new SQLite.Net.Platform.WinRT.SQLitePlatformWinRT();
   var conn = new SQLite.Net.SQLiteConnection(plat,path);

    return conn;
    }
 }

Any help or suggestion would be much appreciated.

Note: I have installed the SQLite.Net-PCL and added reference to SQLite for Universal App Platform

Aucun commentaire:

Enregistrer un commentaire