开发者

cannot save record in attached .mdf file with EF 4.0

开发者 https://www.devze.com 2023-03-03 05:31 出处:网络
I want to create a VS 2010 project with EF 4.0 model. But I have no records and errors after inserting new recordwith attached .mdf file .

I want to create a VS 2010 project with EF 4.0 model.

But I have no records and errors after inserting new record with attached .mdf file .

But if t开发者_如何转开发he base is connected to Sql Server, it works fine.

Please help me to insert records to attached .mdf db


You need to make sure DB is not in a shared folder, is on your pc, is not read only, that you have write permissions to the folder that contains it and there is no DB already attached to service with same name. Make sure you can connect with Server Explorer window first.

Consider using SQL Server CE, if you want to work with loose DB files.

Also, make sure the file is not overwritten with each build. (Use "Copy if newer", not "Copy always".)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号