LinqToSql _向后兼容性问题 [英] LinqToSql _ Backward compatibility issue
问题描述
我正在使用LinqToSQL在SQLite数据库文件中保存数据。问题是,在Entity类中添加新属性(Column)之后,无法读取现有数据库文件,并且它会抛出错误,表示Column缺失。
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.
那么是否有任何更新机制当模型类和数据库中的相应表存在差异时,现有的旧SQLite数据库文件(在连接到数据库时)具有新列的默认值。
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.
谢谢
deepak
推荐答案
我使用LinqToSQL在SQLite数据库文件中保存数据。问题是,在Entity类中添加新属性(Column)之后,无法读取现有数据库文件,并且它会抛出错误,表示Column缺失。
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.
那么是否有任何更新机制当模型类和数据库中的相应表存在差异时,现有的旧SQLite数据库文件(在连接到数据库时)具有新列的默认值。
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.
谢谢
deepak
这是EF论坛。您可以发布MSDN Linq-2-SQL论坛。
This the EF forum. There is a MSDN Linq-2-SQL forum you can post to.
这篇关于LinqToSql _向后兼容性问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!