Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

I cannot open my db

2006-02-15
2013-04-15
  • Hello,

    I'm trying to open the SQLite3 Database from the application XboxMediaCenter, but when i call Open() i have a "System.NullReferenceException" from " sqlite.net.dll"!

    My code is very simple:
    SQLiteConnection sql = new SQLiteConnection("Data Source=C:\\MyVideos31.db;Version=3");
    sql.Open();

    I can open the database with SQLiteSpy for example!

    Can somebody help me?

    Thank you.

     
    • I make some tries, and i put the SQLite.NET project in my own project to try to find the bug!

      In debug mode i found where is the error :

      >sqlite.net.dll!Finisar.SQLite.sqlite3.exec(string sql = "pragma synchronous = Normal") Line 630

      >sqlite.net.dll!Finisar.SQLite.SQLiteConnection.Open() Lie 337

      At this line :
      sqlite3_exec(DB,m.GetSQLiteStr(),IntPtr.Zero,IntPtr.Zero,out errmsg);

      Please help me!

       
    • Just a wild shot in the dark: try adding UTF16Encoding=True

      if that doesn't do it, CREATE it with this adapter first and then connect.

      When you touch stuff with anything other than this adapter it seems like the adapter goes crazy :)

      Use New=True to create a new database.