SQLiteConnection statement error!

Issue #62 invalid
Sumesh Chandran created an issue

Hi all,

I am very new to this site. I am not sure this site works like any other forums you see out there. Since I found some interesting and helpful code snippets here, I just thought of going ahead and post a small issue here.

I would also like to mention that I am very new to the whole SQLite thing. I am getting a blue squiggly under this line which starts with SQLiteConnection, not sure what i am missing. I was using SQLiteAsyncConnection, since I read somewhere that it doesn't support methods like InsertWithChildren, thought of trying out the SQLiteConnection class.

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

These are the using statements I have on top:

using SQLite.Net;
using SQLiteNetExtensions.Extensions;

And this is the error message I am getting. "Error 2 'SQLite.Net.SQLiteConnection' does not contain a constructor that takes 1 arguments D:\OneDrive\Projects\SQLiteAsyncConnection Class\sqlite-net\MainPage.xaml.cs 28 31 sqlite-net"

Please advise! Thank you.

Comments (3)

  1. Guillermo GutiƩrrez

    You are not using any SQLite-Net Extensions in that code. You are missing the ISQLitePlaform parameter in the SQLiteConnection. For example, if using Windows Phone 8.1 or Windows RT, you'll use:

    var db = new SQLiteConnection(new SQLitePlatformWinRT(), dbPath)
    
  2. Log in to comment