|
-
Jul 1st, 2002, 06:51 AM
#1
Thread Starter
Lively Member
custom configuration sections
i have a custom configuration file called appFollow.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="DPAFOLLOWUPTOOL" type="System.Configuration.SingleTagSectionHandler" />
</configSections>
<DPAFOLLOWUPTOOL
sqlServer="ELSQLSRV1"
sqlDB="DPA_FollowUp"
networkDir="\\elntsrv4\apps\PRP\DPA FollowUp\" />
</configuration>
i read the sqlServer, sqlDB and networkDir values in the following class:
Imports System.Configuration
Imports System.Collections
Public Class clsConfig
Public Sub GetConfigurations()
Dim appTable As IDictionary
appTable = CType(ConfigurationSettings.GetConfig("DPAFOLLOWUPTOOL"), IDictionary)
modFollow.configSQLServer = CType(appTable("sqlServer"), String)
modFollow.configSQLDB = CType(appTable("sqlDB"), String)
modFollow.configNetworkDir = CType(appTable("networkDir"), String)
End Sub
End Class
but i get the following error where i try to get the first value - "sqlServer"
An unhandled exception of type 'System.NullReferenceException' occurred in DPAFollow.exe
Additional information: Object reference not set to an instance of an object.
it's as if it's not reading anything from my config file.
is there somehwhere that i have to specify my config file?
any other ideas?
thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|