Lee:
When I get to the Type.GetType(Globals.Settings.Store.ProviderType) in the CreateInstance Property the and check the value of the Globals.Settings.Store.ProviderType in the immediate window it says
Settings is not a member of Globals, even though all of the Globals.setting.Store properties are displayed in Intellisense.
Here is the contents of my Web.Config as it relates to these elements:
<configSections>
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensions SectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGro up, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptReso urceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebService sSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerial izationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere"/>
<section name="profileService" type="System.Web.Configuration.ScriptingProfileSer viceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthentica tionServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
</sectionGroup>
</sectionGroup>
</sectionGroup>
<section name="TheBMTStore" type="JG.BMTStore.TheBMTStoreSection"/>
</configSections>
<connectionStrings>
<add name="connBMT" connectionString="Data Source=seb2a54; Initial Catalog=BMTStore; User ID=BMTStoreUser; Password=atlas458" providerName="System.Data.SqlClient"/>
<add name="BMTStoreConnectionString" connectionString="Data Source=seb2a54;Initial Catalog=BMTStore;Integrated Security=True" providerName="System.Data.SqlClient"/>
</connectionStrings>
<appSettings>
<add key="connBMT.ConnectionString" value="Data Source=seb2a54;Initial Catalog=BMTStore;User ID=BMTStoreUser;Password=atlas458"/>
<add key="TheBMTStore.ConnectionString" value="Data Source=seb2a54;Initial Catalog=BMTStore;User ID=BMTStoreUser;Password=atlas458"/>
<add key="EnableCaching" value="true"/>
<add key="CacheDuration" value="600"/>
</appSettings>
<TheBMTStore defaultConnectionStringName="connBMT" >
<contactForm mailTo="Phi.eSupply.Request@ssa.gov"/>
<store businessEmail="Phi.eSupply.Request@ssa.gov" providerType="JG.BMTStore.DAL.SQLClient.SqlStorePr ovider" />
</TheBMTStore>
I added the providerType to the store element
Here is the Globals.
vb Class:
Imports System.Web.Configuration
Imports Microsoft.VisualBasic
Namespace JG.BMTStore
Public NotInheritable Class Globals
Public Shared ReadOnly Settings As TheBMTStoreSection = _
CType(WebConfigurationManager.GetSection("TheBMTSt ore"), TheBMTStoreSection)
End Class
End Namespace
In the ConfigSection.
vb I have Classes defined for the TheBMTStoreSection, ContactFormElement and the StoreElement and an empy class named ConfigSection. The StoreElement is built from the TheBMTStoreSection property store.
Can you spot anything that wrong?