1

hello i'm using visual studio 2008, vb.net and oracle as my db. this is what i save in my apps.config

<appSettings/>
<add key="SMSDW_connection" value="server=abc;database=efg;User ID=**;Password=**;"/>

and this is my code for calling the apps.config file :

    Dim connectionString = System.Configuration.ConfigurationManager.AppSettings("SMSDW_connection")
    Dim sqlConnection As OracleClient.OracleConnection = New OracleClient.OracleConnection(connectionString)

but still i got an error which is :

The ConnectionString property has not been initialized.

i have add reference System.Configuration and Imports System.Configuration

Husna5207
  • 449
  • 3
  • 10
  • 28

1 Answers1

0

The <appSettings> node has the closing tag "/" so the <add is outside of it.

it should read:

<appSettings>
<add ...
</appSettings>
Johnfed
  • 106
  • 5