SubSonic部署和更改连接字符串

时间:2009-04-16 19:31:03

标签: subsonic data-access-layer connection-string

我使用Subsonic为我的一个Web应用程序构建DAL。当我将它从测试服务器移动到生产服务器时,我将连接字符串更改为指向生产数据源,但应用程序仍然针对测试数据库运行。除了Web.config之外,连接信息是否也存储在其他地方?

部署使用Subsonic构建的Web应用程序的最佳做法是什么?

TIA

约翰

2 个答案:

答案 0 :(得分:0)

SubSonicService配置部分中,connectionStringName属性是否指向正确的连接字符串?

答案 1 :(得分:0)

以下是我的配置示例。

        <!--########################## Connection Strings ###############################-->
        <connectionStrings>
        <clear/>
        <add name="Ajax" 
connectionString="Data Source=Ajax1;Initial Catalog=AjaxExample_test;User ID=Webuser;Password=Pinecone!" 
providerName="System.Data.SqlClient"/>
        </connectionStrings>
        <!--########################## SubSonic ###############################-->
            <SubSonicService defaultProvider="AjaxProv">
             <providers>
              <clear/>
             <add name="AjaxProv" type="SubSonic.SqlDataProvider, SubSonic"
     connectionStringName="Ajax" 
    generatedNamespace="ICBA.Web.SalesForce.StagingDAL" 
    appendWith="" 
    stripColumnText="" 
    relatedTableLoadPrefix="" 
    enableTrace="false" 
    extractClassNameFromSPName="false" 
    fixDatabaseObjectCasing="true" 
    fixPluralClassNames="true" 
    generateLazyLoads="false" 
    generateNullableProperties="true" 
    generateODSControllers="true" 
    generateRelatedTablesAsProperties="false" 
    includeProcedureList="*" 
    excludeTableList="" 
    includeTableList="*" 
    regexDictionaryReplace="TypeCode,typecode" 
    regexIgnoreCase="true" 
    removeUnderscores="true" 
    setPropertyDefaultsFromDatabase="false" 
    useExtendedProperties="false" 
    useSPs="true"/>
           </providers>
          </SubSonicService>