Remove ConnectionString from app.config
645759Jun 18 2008 — edited Sep 23 2008Hello everybody,
Is there any way to remove/hide/encrypt the connection details in a connectionString?
My Problem is:
I've got a Windows Forms Application and I want to use OracleMembershipProvider and OracleRoleProvider.
My App.Config looks the following:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
</configSections>
<connectionStrings>
<add name="TNTConnectString" connectionString="user id=user;password=pwd;data source=some_connection;" providerName="Oracle.DataAccess.Client" />
</connectionStrings>
<system.web>
<roleManager enabled="true" defaultProvider="MyOracleRoleProvider">
<providers>
<add connectionStringName="TNTConnectString" name="MyOracleRoleProvider" type="Oracle.Web.Security.OracleRoleProvider, Oracle.Web, Version=2.111.6.20, Culture=neutral, PublicKeyToken=89b483f429c47342" applicationName="some_name"/>
</providers>
</roleManager>
<!-- Enable and customize OracleMembershipProvider settings -->
<membership defaultProvider="MyOracleMembershipProvider">
<providers>
<add connectionStringName="TNTConnectString" applicationName="some_name" name="MyOracleMembershipProvider" type="Oracle.Web.Security.OracleMembershipProvider,Oracle.Web, Version=2.111.6.20, Culture=neutral,PublicKeyToken=89b483f429c47342"/>
</providers>
</membership>
</system.web>
</configuration>
Now the problem is that the app.config file has to be copied to every location where I want to use this program, so everybody can read the connection string and connect to DB.
Is there any possibility to add the connection string at runtime? Or any other ways to avoid writing the ConnectionString in plain text to app.config?
Though this is not a special Oracle Problem I hope anybody can help =)
Thanks in advance,
Florian Fanderl