none
Creating new DB from existing DB SQLite RRS feed

  • Question

  • Hey  guys . I am using EF 6 and MVC , I have a Sqlite connected to my project, and from that DB the content of db is loaded on html tables like this.

    And what I wanna implement is when clicking on a button,let's say located on bottom of page(that does not matter), I have to create a new SQLite db file and all changes that were made to my default db to assign to that new db. 

    I did something like this.

                var sqlite = new SQLiteConnection("Data source=C:\\Users\\Edo\\Documents\\Visual Studio 2013\\Projects\\TranslatorAmgAttendanceSystem\\TranslatorAmgAttendanceSystem\\App_Data\\Lang.s3db,Password=Loighess comno eci");
                sqlite.Open();
                System.Data.SQLite.SQLiteConnection.CreateFile("E:\\Lang.s3db");
                System.Text.StringBuilder query = new System.Text.StringBuilder();
                query.Append("ATTACH E:\\Lang.s3db AS SecondaryDB");
                query.Append("INSERT INTO Translations SELECT * FROM SecondaryDB.Translations");

    But I can't manage how put data from my db to main db :/ Can you help please ? 

    Thanks

    Tuesday, September 16, 2014 1:38 PM

Answers

  • Hello Romo,

    >> But I can't manage how put data from my db to main db :/ Can you help please ?

    From your description, it seems that you would create the new database at run time. You might need to insert the data from the web page to the new created database using a way similar with the Sqlite database syntax since Entity Framework does not support to create a model at run time, for the detail syntax, I would suggest that you could post it to the Sqlite forum:

    http://www.sqlite.org/support.html

    Best Regards,

    Fred.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, September 17, 2014 1:54 AM
    Moderator