I have created a Connection manager in my SSIS project for database connectivity.I choose SQLClient Data Provider and select SQL server authentication mode for login.Test connection succeeded. In Script Task I'm using following to get the connectionstring:
string strConnection = Dts.Connections["Target_DB"].ConnectionString;
While debug I found following only:
Data Source=ServerName;User ID=myid;Initial Catalog=product;Persist Security Info=True;
As you can see password is missing and that's why I'm not able to connect to database server Even Test connection succeeded.
Does this means it's not saving password if so then how can I connect to database.
---------------UPDATE---------------------
I added App.config file in ScriptTask and added ConnectionString node in it.Then I tried to access connection string in following manner but couldn't succeeded and it's showing some other connection string not the one which I have written:
string strConnection = ConfigurationManager.ConnectionStrings["CRMConnectionString"].ConnectionString;
Thanks