Hello,
I know how to add custom values to connection string in web.config using properties. But what if I have to modify connection string depending on user's choice? I mean a scenario like the following:
During installation, user can select type of sql authentication: will it be sql server authentication or windows authentication. So, in the case of sql authentication type, connection string will be like the following: <add name="myname" connectionString="Data Source=.;Initial Catalog=mydatabase;user id=myuser;password=mypass;Async=true"/>. In the case of windows authentication, connection string should be like the following: <add name="myname" connectionString="Data Source=.;Initial Catalog=mydatabase;Integrated Security=SSPI;Async=true"/>.
I am able to modify connection string using custom properties, i.e.: Data Source=.;Initial Catalog=[DB_NAME_PROP]
So, the question is: how can I transform first connection string into another, if user selects windows authentication? How can I delete user id and password from connection string and add Integrated Security=SSPI depending on a property?
Thank you very much.
FOLLOW US
Get the latest news in Application Packaging