How can I hide my password in my C# Connection string?

后端 未结 5 1964
时光取名叫无心
时光取名叫无心 2020-12-03 11:11

I have the following connection string:

Data Source=Paul-HP\\MYDB;Initial Catalog=MyMSDBSQL;Persist Security Info=True;User ID=sa;Password=password
         


        
5条回答
  •  無奈伤痛
    2020-12-03 11:37

    Probably easiest to encrypt the connection strings within the web.config or app.config

    See How To: Encrypt Configuration Sections in ASP.NET 2.0 Using DPAPI

提交回复
热议问题