If you have full control then yes I would just use the config file. Here is a minimalist example note(there is nothing different about dnn setup if you choose to use the config file, its just the same as a regular webform project)
Code:
1 <configSections>
2 <sectionGroup name="EntitySpaces"
3 type="EntitySpaces.Interfaces.esConfigSettings, EntitySpaces.Core">
4 <section name="connectionInfo"
5 type="EntitySpaces.Interfaces.esConfigSettings, EntitySpaces.Interfaces"
6 allowLocation="true" allowDefinition="Everywhere" restartOnExternalChanges="true"/>
7 </sectionGroup>
8 </configSections>
9
10 <EntitySpaces>
11 <connectionInfo default="SQL">
12 <connections>
13 <add name="SQL" providerMetadataKey="esDefault" sqlAccessType="DynamicSQL"
14 provider="EntitySpaces.SqlClientProvider" providerClass="DataProvider"
15 connectionString="Server=Scattorshot\Sql2005;Database=Northwind;Trusted_Connection=Yes;"/>
16 </connections>
17 </connectionInfo>
18 </EntitySpaces>
You will also need to add this to your Global.asax application start
Code:
1 protected void Application_Start(object sender, EventArgs e)
2 {
3 //---------------------------------------------------------------
4 // Assign the Medium Trust Loader
5 //---------------------------------------------------------------
6 EntitySpaces.Interfaces.esProviderFactory.Factory =
7 new EntitySpaces.LoaderMT.esDataProviderFactory();
8 }
Regards,
Scott Schecter
EntitySpaces |
My Site