LINQ to SQL(使用sql server)

之前用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

猜你喜欢

转载自blog.csdn.net/gbstack08/article/details/7543866