LINQ to SQL(使用sql server)

来源:互联网 发布:淘宝评价网址 编辑:程序博客网 时间:2024/05/16 08:47

之前用DBLinq想在sqlite环境使用LINQ to SQL, 但一直有错误(DataContext.SubmitChanges()遇到一个exception)

昨天用了sql server后便成功了.

 

mysql中primary key auto_increment对应sql server中的identity.

在model class中要对主键属性设置ColumnAttribute的isPrimaryKey为true, 还需要设置isDbGenerated为true, 对应auto_increment