How can i use SQLite in my Shared Library?

C64GamerC64Gamer USMember ✭✭

Hello,

i want to use SQLite in my shared library cross platform project. Adding it in Xamarin.Android or Xamarin.iOS is not really the problem. I don't want to write the same database code twice. Is there a way to write a dataManager for sqllite in the shared libs?

Cheers
Norman

Best Answer

Answers

  • AdamPAdamP AUUniversity ✭✭✭✭✭

    @WFLNorman - Xamarin have an example of SQLite from a SharedProject here: https://developer.xamarin.com/guides/xamarin-forms/working-with/databases/

  • C64GamerC64Gamer USMember ✭✭

    Thx. :-) I will try my luck.

  • C64GamerC64Gamer USMember ✭✭

    I have implemented the SQLite.cs from the linked github page and did all steps from the tutorial for shared librarys.
    When i try to compile my project i get the following error:

    Line 1018 in SQLite.cs: Thread.VolatileWrite (ref _transactionDepth, depth);
    The name 'Thread' does not exist in the current context.

  • rizwanrizwan INMember

    Hi,

    I am getting the same errors 66 in number as the one you got, when I added Sqlite-net Package in the shared project of xamarin.
    Were you abel to solve this issue ? How ?

    Thanks,
    Rizwan

Sign In or Register to comment.