开发者

Why Mysql not give me my connectionstring back with password when I open the connection with constring who have password;

开发者 https://www.devze.com 2023-02-16 12:50 出处:网络
I define the password in connstring and open the connection using them I just debug the code and break this thing.

I define the password in connstring and open the connection using them I just debug the code and break this thing.

cmd.Connection.ConnectionString

they give me every information about the th开发者_开发百科ings I defined in connectionstring but not my password.

It is a security issue I know that but anyone tell me how I can run a command using the same connectionstring if I want to use them same thing.

I have the connectionstring in global variable but tell me if it's possible to execute a command by getting the connectionstring from the connection I open.


Add Persist Security Info=True to your connectionstring.

By default, the password is removed from the connectionstring once the connection has been opened. This is for security purposes, so as to keep the password around in memory only as long as needed.

Here is some information in the docs about this.

0

精彩评论

暂无评论...
验证码 换一张
取 消