How to retrieve the ConnectionString from web.config into a string variable?

Hi there,
I have the following in my web.config:

configuration>
      <appSettings/>
      <connectionStrings>
            <add name="Oracle FCCI_BH ConnectionString" connectionString="Data Source=SALANORA;Persist Security Info=True;User ID=FCCI_BH;Password=fcciadmin;Unicode=True" providerName="System.Data.OracleClient"/>
      </connectionStrings>
      <system.web>


How to retrieve my connectionString assigned above in my web.config file and place it into normal string variable?

Dim Conn_Str as String = ?...... the connectionString from web.config .....?

Thanks in advanced
Salan
LVL 2
salan_alaniAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Guy Hengel [angelIII / a3]Billing EngineerCommented:

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
hismightinessCommented:
The way I know is:

WEB.CONFIG:

<appSettings>
     <add key="ConnectionString" value="server=SERVERNAME;database=DATABASENAME;User Id=USERNAME;Password=PASSWORD;" />
</appSettings>

CODE BEHIND:

Dim Conn As New SqlConnection(System.Configuration.ConfigurationSettings.AppSettings("ConnectionString"))
salan_alaniAuthor Commented:
Thanks for your support,
Actuall,y I discovered now that in ASP.NET 2.0 you could do the following to solve my problem (as an example):

Dim Conn_Str As String = System.Configuration.ConfigurationManager.ConnectionStrings.Item("Oracle FCCI_BH ConnectionString").ConnectionString

BR,
Salan
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.