Hi all,
I got a little problem when trying to retrieve my connectionString from app.config. Here's my code:
APP.CONFIG:
---------------
Connection code:
--------------------
I have tried it all, but I keep getting this error:
Object reference not set to an instance of an object.
I have the correct imports and reference in my project, read it a thousand times on forums, but I keep having this error ...
Anyone got an idea?
Thanks in advance,
-Yakkity
I got a little problem when trying to retrieve my connectionString from app.config. Here's my code:
APP.CONFIG:
---------------
HTML:
<connectionStrings>
<add name="TestServerString" connectionString="working string"
providerName="System.Data.Odbc" />
</connectionStrings>
Connection code:
--------------------
HTML:
'Connection = New PsqlConnection("working string")
'And that does work, BUT I want to get it from app.config like this:
ConfigurationManager.ConnectionStrings("TestServerString").ConnectionString
'ConfigurationManager.ConnectionStrings("TestServerString").ConnectionString.toString
'ConfigurationManager.ConnectionStrings("TestServerString")
I have tried it all, but I keep getting this error:
Object reference not set to an instance of an object.
I have the correct imports and reference in my project, read it a thousand times on forums, but I keep having this error ...
Anyone got an idea?
Thanks in advance,
-Yakkity
Last edited: