Persist Security Info Property=true and Persist Security Info Property=false

99封情书 提交于 2019-11-28 13:15:56

Even if you set Persist Security Info= true OR Persist Security Info=false it won't show a difference in front..The difference is happening at background

When Persist Security Info set to false security-sensitive information, such as the password, is not returned as part of the connection if the connection is open or has ever been in an open state.

If you set Persist Security Info to True, Windows will remember the password specified in the connection string.

Thats the difference.

MSDN Explanation

setting Persist Security Info true or false will come into effect only if you mention username and password in connection string. If you mention username and password in connectionstring and set Persist Security Info as false then the credentials cannot be extracted. but if you set Persist Security Info as true while giving credentials in the connectionstring windows will remember the credentials and it can extracted in program

I found this answer here from Dan Guzman, SQL Server MVP:

I suggest you specify FALSE or omit the keyword entirely since it is the default, even during development. The only time you need to specify TRUE is if the application uses SQL authentication and subsequently retrieves the password from the connection object, which in my experience is rarely done or needed. Performance is not a concern.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!