这里写自定义目录标在这里插入代码片题
C# O/RM操作数据库问题实录
以下是作者遇到的一些问题与解决方案,分析给大家希望有帮助。
connection 连接问题
报错信息:
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.
解决方案:
1、connection配置中加入: Integrated Security=True,表示可以在不知道数据库用户名和密码的情况下,依然可以连接数据库
2、connection配置中加入:Persist Security Info = True,表示数据库连接成功后是否保存密码信息