在第一次运行程序时,用Entity Framework进行修改和删除时总会报一次 此操作要求连接到 'master' 数据库错误
再次修改或者删除就不会出现此错误,因为Entity Framework 4也是第一次使用  这错误也找了很久
今天有点时间,就耐着性子去google解决办法
找了很久 最后在一个老外的评论回复里找到解决办法


"This operation requires a connection to the
'master' database. Unable to create a connection to the 'master' database
because the original database connection has been opened and credentials have
been removed from the connection string. Supply an unopened connection."


I had this error and solved it by adding "Persist
Security Info=true" to the connection string.


意思是在连接字符串上要加 Persist Security Info=true


Persist Security Info=true
的意思是让.net一直保存着连接密码,默认是为false的


只是不明白 为什么在出现一次错误后 第二次就不会出现 难道出现过错误
.net就自动把密码给保存上了?

相关文章:

  • 2022-12-23
  • 2021-07-24
  • 2021-09-08
  • 2022-12-23
  • 2021-11-07
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-03
  • 2021-07-21
  • 2022-02-01
  • 2021-08-04
  • 2021-06-25
  • 2021-07-02
  • 2022-12-23
相关资源
相似解决方案