Using SQLite in C# without System.Data.SQLite

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Using SQLite in C# without System.Data.SQLite

Jordy Deweer
Dear all

I am new to this group and this is my first question here.

My question is as follows:

Is there a way to use a SQLite database in a C# project, without
installing / configuring / depending on the System.Data.SQLite libraries?

I really hope there is.

Thank you so much in advance for your help.

Best wishes

Jordy

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

Re: Using SQLite in C# without System.Data.SQLite

CedricCicada
Why don't you want to use System.Data.SQLite?

On Thu, Oct 18, 2018 at 11:04 AM Jordy Deweer <[hidden email]> wrote:

> Dear all
>
> I am new to this group and this is my first question here.
>
> My question is as follows:
>
> Is there a way to use a SQLite database in a C# project, without
> installing / configuring / depending on the System.Data.SQLite libraries?
>
> I really hope there is.
>
> Thank you so much in advance for your help.
>
> Best wishes
>
> Jordy
>
> _______________________________________________
> 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
|

Re: Using SQLite in C# without System.Data.SQLite

Larry Brasfield
In reply to this post by Jordy Deweer

Jordy Deweer asks: “Is there a way to use a SQLite database in a C# project, without
installing / configuring / depending on the System.Data.SQLite libraries?

I really hope there is.”

If you do a web search for the combination of terms “SQLite”, “C#” and “library”, you will find several alternative libraries.  Some of them are thinner wrappers (of SQLite) or provide less complete exposure of SQLite’s API.

You have the option of fashioning your own wrapper using the C# P/Invoke mechanism, or you may find the ‘NativeMethods’ functionality of interest.  However, doing this robustly requires enough expertise that you should be wary of tackling the project.

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

Re: Using SQLite in C# without System.Data.SQLite

Jordy Deweer
Larry Brasfield wrote: "Jordy Deweer asks: “Is there a way to use a
SQLite database in a C# project, without
> installing / configuring / depending on the System.Data.SQLite libraries?
>
> I really hope there is.”
>
> If you do a web search for the combination of terms “SQLite”, “C#” and “library”, you will find several alternative libraries.  Some of them are thinner wrappers (of SQLite) or provide less complete exposure of SQLite’s API.
>
> You have the option of fashioning your own wrapper using the C# P/Invoke mechanism, or you may find the ‘NativeMethods’ functionality of interest.  However, doing this robustly requires enough expertise that you should be wary of tackling the project."



Thank you so much for your reply. I sill surely look at the options you
gave me.


I ask because I run into errors a lot, using the System.Data.SQLite
libraries. It easily crashes, trhows exceptions and similar issues... I
found out that it matters which target platform is selected...


So thanks once again.


Regards, Jordy

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

Re: Using SQLite in C# without System.Data.SQLite

CedricCicada
What target platforms have you found on which it is unreliable?  I haven't
had problems on Win7, but I haven't used it all that much.

RobR

On Thu, Oct 18, 2018 at 2:57 PM Jordy Deweer <[hidden email]> wrote:

> Larry Brasfield wrote: "Jordy Deweer asks: “Is there a way to use a
> SQLite database in a C# project, without
> > installing / configuring / depending on the System.Data.SQLite libraries?
> >
> > I really hope there is.”
> >
> > If you do a web search for the combination of terms “SQLite”, “C#” and
> “library”, you will find several alternative libraries.  Some of them are
> thinner wrappers (of SQLite) or provide less complete exposure of SQLite’s
> API.
> >
> > You have the option of fashioning your own wrapper using the C# P/Invoke
> mechanism, or you may find the ‘NativeMethods’ functionality of interest.
> However, doing this robustly requires enough expertise that you should be
> wary of tackling the project."
>
>
>
> Thank you so much for your reply. I sill surely look at the options you
> gave me.
>
>
> I ask because I run into errors a lot, using the System.Data.SQLite
> libraries. It easily crashes, trhows exceptions and similar issues... I
> found out that it matters which target platform is selected...
>
>
> So thanks once again.
>
>
> Regards, Jordy
>
> _______________________________________________
> 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
|

Re: Using SQLite in C# without System.Data.SQLite

Larry Brasfield
In reply to this post by Jordy Deweer
Jordy Deweer asks about alternatives to System.Data.SQLite because: “I run into errors a lot, using the System.Data.SQLite libraries. It easily crashes, trhows exceptions and similar issues...”.

I’ve used that module for several projects and found it to be generally robust. I have also seen that the developers working on it are responsive here (in this forum) and attend to bug reports promptly. It is a quality offering, IMO.

I venture that if you are seeing exceptions thrown from that module, they likely signify usage contrary to the intention underlying the API design.  “Crashes”, (if the term has its usual meanings among SDEs), tend to indicate a bug somewhere. If they can be properly attributed to System.Data.SQLite, (with a simple C# test case), I am sure that the modules developers would jump on a bug report tendered here. I’m not sure what “similar issues” would be, but I imagine that if you brought the difficulties here, you would find willing help to resolve them, as I have seen often.



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

Re: Using SQLite in C# without System.Data.SQLite

Simon Slavin-3
On 19 Oct 2018, at 2:23am, Larry Brasfield <[hidden email]> wrote:

> Jordy Deweer asks about alternatives to System.Data.SQLite because: “I run into errors a lot, using the System.Data.SQLite libraries. It easily crashes, trhows exceptions and similar issues...”.

System.Data.SQLite is generally considered to be stable and usable.  It's officially supported and its maintainer reads this list and responds to bug reports.

If you're getting buggy behaviour out of it, there's a big chance that something else in your project is the cause.  Please post details of your development environment and a bug that's simple to reproduce and we'll talk about it.

But first, please make sure you're detecting and handling errors however your language/environment expect you to, because a lot of errors result in using another SQLite call after one has reported an error.

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

Re: Using SQLite in C# without System.Data.SQLite

Scott Doctor
In reply to this post by Larry Brasfield

Why not just add the amalgmation to your source then do C
function calss. I do not get why you would use a dll when you
can just link in the amalgamtion into your program and have full
access to the latest version.


-------------------------
Scott Doctor
[hidden email]
-------------------------

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

Re: Using SQLite in C# without System.Data.SQLite

Bernd Lehmkuhl-3
In reply to this post by Jordy Deweer
>
> Thank you so much for your reply. I sill surely look at the options you
> gave me.
>
>
> I ask because I run into errors a lot, using the System.Data.SQLite
> libraries. It easily crashes, trhows exceptions and similar issues... I
> found out that it matters which target platform is selected...
>
>
> So thanks once again.
>
>
> Regards, Jordy
>

I dare claim that you're doing something wrong using System.Data.SQLite.
I've been using this library extensively over the past seven or eight
years - starting when it wasn't yet maintained by the SQLite team - and
never had any severe problems. Several gotchas for sure, but certainly
not enough to find it unreliable.
That said I've only coded for windows desktop, so should you be
struggling with Win CE or the kind, I apologize for making my first
claim, as I can't say anything about the library's stability on these
platforms.
As always - examples where your code crashes are a valuable resource to
giving advice what might be done differently (if there is something done
wrong).

Best regards, Bernd

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