·您现在的位置: 云翼网络 >> 文章中心 >> 网站建设 >> 网站建设开发 >> ASP.NET网站开发 >> .NET连接数据库的字符串,密码数据丢失的解决方法(persist security info=true;)

.NET连接数据库的字符串,密码数据丢失的解决方法(persist security info=true;)

作者:佚名      ASP.NET网站开发编辑:admin      更新时间:2022-07-23

连接字符串如下
server=localhost;user=root;passWord=123456;database=test;

可是到了连接里面,就变成了
server=localhost;user=root;database=test;

然后程序运行就出现了 Using Password No的异常信息,

经询问同时,应该增加一个配置参数persist security info=true;
server=localhost;user=root;password=123456;database=test;persist security info=true;

如果不加,则.NET会自动把密码部分去除。

http://www.laozizhu.com/view.jsp?articleId=618