NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 37 38 39 40 41 … 93 Next »
Exception when querying gbpvr.db3

 
  • 0 Vote(s) - 0 Average
Exception when querying gbpvr.db3
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,583
Threads: 384
Joined: Dec 2004
#1
2007-12-16, 01:30 AM
I get the following exception when attempting to query the DB from my plugin.

Code:
DVBTR: System.EntryPointNotFoundException: Unable to find an entry point named 'sqlite3_errmsg_stmt_interop' in DLL 'System.Data.SQLite.DLL'

I could understand a DB 'locked' exception or various others but I don't understand this DLL entry point error.

Code as follows...
Code:
SQLiteConnection conn = null;
SQLiteCommand comm = null;
SQLiteDataReader dr  = null;

conn = new SQLiteConnection("data source=" + GBInstallDir + "gbpvr.db3");

comm = new SQLiteCommand("SELECT BDA_RECORDING_SOURCE.board, CAPTURE_SOURCE.name, BDA_RECORDING_SOURCE.capture_source_oid FROM BDA_RECORDING_SOURCE INNER JOIN CAPTURE_SOURCE ON BDA_RECORDING_SOURCE.capture_source_oid = CAPTURE_SOURCE.oid", conn);

comm.CommandType = System.Data.CommandType.Text;
comm.Connection.Open();
dr = comm.ExecuteReader();
To be honest, I'm not sure where I got that SQL query from as it was a couple of months ago when I did it. I think it was probably a VS DataSet wizard generation. It looks OK to me as far as I can tell.

I don't understand the 'entry point' thing. Any ideas? Google isn't helping.

[EDIT] The exception occurs at the comm.ExecuteReader() point.

Cheers,
Brian
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,727
Threads: 767
Joined: Nov 2003
#2
2007-12-16, 01:52 AM
Sorry, I'm not really sure. Its not something I've come across.

I dont use the SQLite classes directly. I use the generic data access classes and it seems to work fine so you might want to try that.
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,583
Threads: 384
Joined: Dec 2004
#3
2007-12-16, 02:20 AM
sub Wrote:I dont use the SQLite classes directly. I use the generic data access classes and it seems to work fine so you might want to try that.
Thanks - I'll try the generic stuff to see if it makes a difference but I think it's due to me doing this from within a plugin.

I just tried the same code in my command-line exe and it worked without a hiccup. Problem is - I want the exe to be just a drone, i.e., the plugin should work out an available tuner and tell the exe to use it.

LOL - nothing's ever easy. Good job I've got a sense of humour. Big Grin

Cheers,
Brian
Ommina
Offline

Senior Member

Posts: 330
Threads: 39
Joined: Feb 2006
#4
2007-12-16, 03:52 AM
Entry Point Not Found -- something is trying to call a function in the DLL and not finding it.

Sooo, I'd check to ensure that the version of the SQLite DLL and the SQLite data providers are playing well.

I'm using the SQLite provider and the SQLite DLL sub includes with the gbpvr install, I'll see if I can come up with some version numbers.
JavaWiz
Offline

Posting Freak

Jacksonville, FL. USA
Posts: 2,522
Threads: 141
Joined: Dec 2006
#5
2007-12-16, 04:29 AM (This post was last modified: 2007-12-16, 04:42 AM by JavaWiz.)
Make sure you reference the System.Data.SQLite.dll in the gbpvr directory. It should display as version 1.0.30.1 in the properties.

The order I use is something like this:

Code:
private SQLiteDataReader mSqlDataReader = null;
private SQLiteConnection mSqlConn = null;

public SQLiteDataReader OpenSqlReader(string sqlStatement, string dbLocation)
{
    mSqlConn = new SQLiteConnection("Data Source=" + dbLocation + ";Version=3;New=True;Compress=True;");
    mSqlConn.Open();
    
    SQLiteCommand cmd = new SQLiteCommand(sqlStatement, mSqlConn);
    mSqlDataReader = cmd.ExecuteReader();
    return mSqlDataReader
}


public void CloseSqlReader()
{
    if (mSqlDataReader != null)
    {
        mSqlDataReader.Close();
        mSqlDataReader.Dispose();
    }
    if (mSqlConn != null)
    {
        mSqlConn.Close();
        mSqlConn.Dispose();
    }
    mSqlDataReader = null;
    mSqlConn = null;
}


public void someMethod()
{
    string sql = "SELECT * FROM Movies WHERE title LIKE '@@%'";
    SQLiteDataReader dr = OpenSqlReader(sql, MovieWizDbLoc);
    if (dr.HasRows)
        while (dr.Read())
        {
            MovieEntry me = loadMovieInfoRowFromDB(dr);
            list.Add(me);
        }
    CloseSqlReader();
}

basically, someMethod drives the code to :

1) Open the reader with specific sql and dbName
2) Process the result set
3) Close the SQLite connection and clean up the objects

I've left the try catch blocks out for clarity
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,583
Threads: 384
Joined: Dec 2004
#6
2007-12-16, 07:47 PM
JavaWiz Wrote:Make sure you reference the System.Data.SQLite.dll in the gbpvr directory. It should display as version 1.0.30.1 in the properties.
Thanks - that was it. My code was fine, just the version of the SQLite ADO.NET provider.

I had v1.0.42.0 installed on my machine and was using that in project references. I've reverted back to an older version - it's actually 1.0.31.0 as SourceForge doesn't have an archive of 1.0.30.1. It works from the plugin now.

Cheers,
Brian
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  TitanTv Remote Schedule For GBPVR UncleJohnsBand 51 33,801 2015-08-20, 05:11 PM
Last Post: sub
  Puzzling exception bgowland 2 1,699 2012-03-07, 02:30 AM
Last Post: bgowland
  Roku & GBPVR pvruser 16 11,531 2011-10-16, 08:31 PM
Last Post: pvruser
  (Yet Another) Rename Helper script for GBPVR & NPVR pvruser 2 2,737 2011-07-22, 01:27 AM
Last Post: pvruser
  Live GBPVR CD/DVD/Thumb drive :D pBS 101 28,680 2010-01-03, 06:22 AM
Last Post: pBS
  some help on basic gbpvr plugin code Etacovda 12 4,666 2009-06-14, 08:24 PM
Last Post: Etacovda
  PlayAudioFile() throws exception bgowland 2 1,582 2008-10-09, 10:37 PM
Last Post: bgowland
  Linking gbpvr.db3 to Access 2003: get readonly tables Khurram 5 3,934 2008-09-11, 08:35 AM
Last Post: Khurram
  UAC and Vista with GBPVR systemshark 2 1,935 2008-08-03, 07:20 AM
Last Post: systemshark
  Controlling an Audio Receiver with the GBPVR remote erik 7 2,723 2008-06-01, 08:31 PM
Last Post: erik

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode