遗忘海岸

江湖程序员 -Feiph(LM战士)

导航

关于Persist Security Info=True,又遇sa登陆失败的错误

<add name="JL_MFGContext" providerName="System.Data.SqlClient" connectionString="Data Source=192.168.xx.xx;Initial Catalog=xxxx;UID=sa;PWD=xxxx;Persist Security Info=True;" />

当指定是Persist Security Info=True时,内存中的sqlConnection(conn)对象在Open指定链接后conn.ConnectionString中的PWD是保留的,

如果设置成False那么PWD着被清除,注意不是清除Web.config中的,而是当前实例对象conn.ConnectionString中的PWD

下面的截图使用EF4.1中的 DBCtx已经实例化的连接对象的连接字符串,结果在新链接使用时出现 sa登陆失败的错误

posted on 2011-10-25 18:31  遗忘海岸  阅读(2358)  评论(0编辑  收藏  举报