Quantcast
Channel: .NET Framework Class Libraries forum
Viewing all articles
Browse latest Browse all 8156

configsource problem in app.config file

$
0
0
I have looked at all the examples and posts but still am having problems with this.  I am using 2008 vb.net in app.config to put connection strings into another file.  I get the error:  "connection string property is not initialized."  Needless to say, this works fine when the cn string section is in the app.config.  I have  tried everything and cannot see the problem.

Please have a look. Thanks
smHaig

Here is the relevant app.config code.  I have removed unnecessary sections:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
 <configSections>
  <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
   <section name="FIOES.My.MySettings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
  </sectionGroup>
  <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
   <section name="FIOES.My.MySettings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  </sectionGroup>
  </configSections>
    <connectionStrings  configSource="connStrings.config"/>
      </configuration>

Here is connstrings.config.  It is in the same directory as app.config:

<

connectionStrings>

<

clear />

<

addname="FIOESConnectionString"connectionString="Data Source=SMH5150\sql2005;Initial Catalog=fioes;Integrated Security=True" providerName="System.Data.SqlClient" />

<

addname="FIOES64CnString"connectionString="Data Source=SMH-VISTA64\SQLEXPRESS;Initial Catalog=fioes;Integrated Security=True" providerName="System.Data.SqlClient" />

</connectionStrings>

Viewing all articles
Browse latest Browse all 8156

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>