Visual Studio 2015 Express C# LoadExtension() not working?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Visual Studio 2015 Express C# LoadExtension() not working?

Phil Pollock
I can't get the LoadExtension() function to work under Visual Studio 2015 Express C#. I have tried to load several extensions that do work under the SQLite console but they will not load under C#.  So I created the minimal example of an example extension given on sqlite.org using the half.c source. It loaded and worked under the SQLite console but failed to load it in a simple C# program with the code snippets shown here:


...

using System.Data.SQLite;
...

        SQLiteConnection m_dbConnection;

...

        string str_extension_path = @"C:\Users\Admin\Documents\Visual Studio 2015\Projects\half_ext\half.sqlext";

...

        string str_DB_Connect = "Data Source=" + textBox_DBPath.Text.ToString() + "; Version=3;";
        m_dbConnection = new SQLiteConnection(str_DB_Connect);
        m_dbConnection.Open();
        m_dbConnection.EnableExtensions(true);
        m_dbConnection.LoadExtension(str_extension_path);
...

The program had this exception when the .LoadExtension() executed:

"An unhandled exception of type 'System.Data.SQLite.SQLiteException' occurred in System.Data.SQLite.dllexception
Additional information: SQL logic error or missing database

The specified module could not be found."

I've tried many other approaches, for example, using SELECT load_extension('half.sqlext'), and rebuilt everything in x86 and x64 but to no avail.

Does anyone have a working example with source of an extension and a working VS 2015 C# program that loads it? Or doesn't this feature work.

TNX

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Visual Studio 2015 Express C# LoadExtension() not working?

Joe Mistachkin-3

I can think of one possibility offhand:

The application is running as 32-bit and the extension DLL is 64-bit (or vice-versa).

Sent from my iPhone
https://urn.to/r/mistachkin

> On Mar 17, 2017, at 5:02 PM, Phil Pollock <[hidden email]> wrote:
>
> I can't get the LoadExtension() function to work under Visual Studio 2015 Express C#. I have tried to load several extensions that do work under the SQLite console but they will not load under C#.  So I created the minimal example of an example extension given on sqlite.org using the half.c source. It loaded and worked under the SQLite console but failed to load it in a simple C# program with the code snippets shown here:
>
>
> ...
>
> using System.Data.SQLite;
> ...
>
>        SQLiteConnection m_dbConnection;
>
> ...
>
>        string str_extension_path = @"C:\Users\Admin\Documents\Visual Studio 2015\Projects\half_ext\half.sqlext";
>
> ...
>
>        string str_DB_Connect = "Data Source=" + textBox_DBPath.Text.ToString() + "; Version=3;";
>        m_dbConnection = new SQLiteConnection(str_DB_Connect);
>        m_dbConnection.Open();
>        m_dbConnection.EnableExtensions(true);
>        m_dbConnection.LoadExtension(str_extension_path);
> ...
>
> The program had this exception when the .LoadExtension() executed:
>
> "An unhandled exception of type 'System.Data.SQLite.SQLiteException' occurred in System.Data.SQLite.dllexception
> Additional information: SQL logic error or missing database
>
> The specified module could not be found."
>
> I've tried many other approaches, for example, using SELECT load_extension('half.sqlext'), and rebuilt everything in x86 and x64 but to no avail.
>
> Does anyone have a working example with source of an extension and a working VS 2015 C# program that loads it? Or doesn't this feature work.
>
> TNX
>
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Visual Studio 2015 Express C# LoadExtension() not working?

Phil Pollock
I forgot to mention I tried all combinations of 32-bit, 64-bit together with same results.


________________________________
From: sqlite-users <[hidden email]> on behalf of Joe Mistachkin <[hidden email]>
Sent: Friday, March 17, 2017 8:09 PM
To: SQLite mailing list
Subject: Re: [sqlite] Visual Studio 2015 Express C# LoadExtension() not working?


I can think of one possibility offhand:

The application is running as 32-bit and the extension DLL is 64-bit (or vice-versa).

Sent from my iPhone
https://urn.to/r/mistachkin

> On Mar 17, 2017, at 5:02 PM, Phil Pollock <[hidden email]> wrote:
>
> I can't get the LoadExtension() function to work under Visual Studio 2015 Express C#. I have tried to load several extensions that do work under the SQLite console but they will not load under C#.  So I created the minimal example of an example extension given on sqlite.org using the half.c source. It loaded and worked under the SQLite console but failed to load it in a simple C# program with the code snippets shown here:
>
>
> ...
>
> using System.Data.SQLite;
> ...
>
>        SQLiteConnection m_dbConnection;
>
> ...
>
>        string str_extension_path = @"C:\Users\Admin\Documents\Visual Studio 2015\Projects\half_ext\half.sqlext";
>
> ...
>
>        string str_DB_Connect = "Data Source=" + textBox_DBPath.Text.ToString() + "; Version=3;";
>        m_dbConnection = new SQLiteConnection(str_DB_Connect);
>        m_dbConnection.Open();
>        m_dbConnection.EnableExtensions(true);
>        m_dbConnection.LoadExtension(str_extension_path);
> ...
>
> The program had this exception when the .LoadExtension() executed:
>
> "An unhandled exception of type 'System.Data.SQLite.SQLiteException' occurred in System.Data.SQLite.dllexception
> Additional information: SQL logic error or missing database
>
> The specified module could not be found."
>
> I've tried many other approaches, for example, using SELECT load_extension('half.sqlext'), and rebuilt everything in x86 and x64 but to no avail.
>
> Does anyone have a working example with source of an extension and a working VS 2015 C# program that loads it? Or doesn't this feature work.
>
> TNX
>
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
sqlite-users Info Page<http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users>
mailinglists.sqlite.org
To see the collection of prior postings to the list, visit the sqlite-users Archives. (The current archive is only available to the list ...



>

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
sqlite-users Info Page<http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users>
mailinglists.sqlite.org
To see the collection of prior postings to the list, visit the sqlite-users Archives. (The current archive is only available to the list ...



_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Visual Studio 2015 Express C# LoadExtension() not working?

Phil Pollock
One of my cl library paths was mixing 32-bit, 64-bit versions during the build. Thanks for making me double check.


________________________________
From: sqlite-users <[hidden email]> on behalf of Phil Pollock <[hidden email]>
Sent: Friday, March 17, 2017 9:28 PM
To: SQLite mailing list
Subject: Re: [sqlite] Visual Studio 2015 Express C# LoadExtension() not working?

I forgot to mention I tried all combinations of 32-bit, 64-bit together with same results.


________________________________
From: sqlite-users <[hidden email]> on behalf of Joe Mistachkin <[hidden email]>
Sent: Friday, March 17, 2017 8:09 PM
To: SQLite mailing list
Subject: Re: [sqlite] Visual Studio 2015 Express C# LoadExtension() not working?


I can think of one possibility offhand:

The application is running as 32-bit and the extension DLL is 64-bit (or vice-versa).

Sent from my iPhone
https://urn.to/r/mistachkin

> On Mar 17, 2017, at 5:02 PM, Phil Pollock <[hidden email]> wrote:
>
> I can't get the LoadExtension() function to work under Visual Studio 2015 Express C#. I have tried to load several extensions that do work under the SQLite console but they will not load under C#.  So I created the minimal example of an example extension given on sqlite.org using the half.c source. It loaded and worked under the SQLite console but failed to load it in a simple C# program with the code snippets shown here:
>
>
> ...
>
> using System.Data.SQLite;
> ...
>
>        SQLiteConnection m_dbConnection;
>
> ...
>
>        string str_extension_path = @"C:\Users\Admin\Documents\Visual Studio 2015\Projects\half_ext\half.sqlext";
>
> ...
>
>        string str_DB_Connect = "Data Source=" + textBox_DBPath.Text.ToString() + "; Version=3;";
>        m_dbConnection = new SQLiteConnection(str_DB_Connect);
>        m_dbConnection.Open();
>        m_dbConnection.EnableExtensions(true);
>        m_dbConnection.LoadExtension(str_extension_path);
> ...
>
> The program had this exception when the .LoadExtension() executed:
>
> "An unhandled exception of type 'System.Data.SQLite.SQLiteException' occurred in System.Data.SQLite.dllexception
> Additional information: SQL logic error or missing database
>
> The specified module could not be found."
>
> I've tried many other approaches, for example, using SELECT load_extension('half.sqlext'), and rebuilt everything in x86 and x64 but to no avail.
>
> Does anyone have a working example with source of an extension and a working VS 2015 C# program that loads it? Or doesn't this feature work.
>
> TNX
>
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
sqlite-users Info Page<http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users>
mailinglists.sqlite.org
To see the collection of prior postings to the list, visit the sqlite-users Archives. (The current archive is only available to the list ...



sqlite-users Info Page<http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users>
sqlite-users Info Page<http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users>
mailinglists.sqlite.org
To see the collection of prior postings to the list, visit the sqlite-users Archives. (The current archive is only available to the list ...



mailinglists.sqlite.org
To see the collection of prior postings to the list, visit the sqlite-users Archives. (The current archive is only available to the list ...



>

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
sqlite-users Info Page<http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users>
mailinglists.sqlite.org
To see the collection of prior postings to the list, visit the sqlite-users Archives. (The current archive is only available to the list ...



sqlite-users Info Page<http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users>
sqlite-users Info Page<http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users>
mailinglists.sqlite.org
To see the collection of prior postings to the list, visit the sqlite-users Archives. (The current archive is only available to the list ...



mailinglists.sqlite.org
To see the collection of prior postings to the list, visit the sqlite-users Archives. (The current archive is only available to the list ...



_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Loading...