Forum Discussion

Naveenks's avatar
Naveenks
Contributor
5 years ago
Solved

Password in encripted format for sql database in connection string

Hi,

 

I am having connection string for my SQL server where in which i need to enter plain password for connction through database.Is there any way so that i can hide or display that password in encripted format.Below is my connection string code :-

 

var ConnectionString = "DRIVER=SQL Server;SERVER=H_kptest;UID=aaa;PWD=aaa";

 

This password aaa should be in encripted format.

 

Regards,

Naveen

  • Sure... my intention was in script.  So, what you would do is something like this.

    var ConnectionString = "DRIVER=SQL Server;SERVER=H_kptest;UID=aaa;PWD=" + Project.Variables.password.DecryptedValue;

4 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    You can store the password in a persistant project variable specifically for a password and then pass in the Decrypted value as a string to that connection string without having to have it open in plain text.

    • Naveenks's avatar
      Naveenks
      Contributor

      Hi ,

       

      I want it through script if we have any approach for that.

       

      Regards,

      Naveen..

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        Sure... my intention was in script.  So, what you would do is something like this.

        var ConnectionString = "DRIVER=SQL Server;SERVER=H_kptest;UID=aaa;PWD=" + Project.Variables.password.DecryptedValue;