none
SQLite file creation using Entity framework RRS feed

  • Question

  • Hi,

    My requirements is as below.

    From my C# application i need to create sqlite database file (say C:\test.sqlite) based on my model class.

    For ex : i have a model class (code first)as below

    Class Table { String Column1 {get;set;}  string Column2 {get;set;} }

    Now i should save objects of this class to sqlite file and i dont want to use database browser to create these  database file

    It would be helpful if i get any sample application as i am new to this technology

    thanks

    Thursday, November 10, 2016 6:52 AM

All replies

  • Hi deeps12345,

    As far as I know, the EF6 provider implementation in System.Data.SQLite.EF6 doesn't support creating tables. The SQLite EF6 provider is basically the same as their Linq implementation so it's all aimed at querying the database rather than modifying it. if you want to change table structure, I would suggest that you could modify it on SQLite Database, and then the entity class.

    About entity framework and SQLite, please refer to the following article.

    http://www.codeproject.com/Tips/1056400/Setting-up-SQLite-and-Entity-Framework-Code-First

    Best regards,

    Cole Wu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, November 11, 2016 2:05 AM
    Moderator