none
LinqToSql _ Backward compatibility issue RRS feed

  • Question

  • Hi,

    I am using LinqToSQL to save data in SQLite database file. The issue is, after adding new property (Column) in Entity class, unable to read existing database file and it throws error saying Column is missing. 

    So is there any mechanism to update existing old SQLite database file (on connecting to databse) with default value for the new columns, when there is difference in model class and corresponding table in database.

    Thanks

    deepak


    Wednesday, November 9, 2016 3:12 PM

All replies

  • Hi,

    I am using LinqToSQL to save data in SQLite database file. The issue is, after adding new property (Column) in Entity class, unable to read existing database file and it throws error saying Column is missing. 

    So is there any mechanism to update existing old SQLite database file (on connecting to databse) with default value for the new columns, when there is difference in model class and corresponding table in database.

    Thanks

    deepak



    This the EF forum. There is a MSDN Linq-2-SQL forum you can post to.
    Wednesday, November 9, 2016 7:32 PM
  • Hi deeps12345,

    Please check if it is a Entity Framework project, if it is, you could use migration to achieve it. For more information, please refer to:

    http://hintdesk.com/sqlite-with-entity-framework-code-first-and-migration/

    If it is LinqToSQL project, I would suggest that you add the column in your SQLite database by manually.

    Note:This response contains a reference to a third party World Wide Web site.Microsoft is providing this information as a convenience to you. 

    Microsoft does not control these sites and has not tested any software or information found on these sites;Therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information
    found there.

    There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.


    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.

    Thursday, November 10, 2016 3:31 AM
    Moderator