在项目中加入SubSonic.dll的引用;

在项目web.config的configuration中加入

<configSections>
   <section name="SubSonicService" type="SubSonic.SubSonicSection, SubSonic" requirePermission="false"/>
</configSections>

<connectionStrings>
   <clear/>
   <add name="MySqlDataConnection" connectionString="Data Source=dataserveripornamepipe;Database=database;User ID=username;Password=password"/>
</connectionStrings>
<SubSonicService defaultProvider="MySqlData">
   <providers>
    <clear/>   
    <add name="MySqlData" type="SubSonic.MySqlDataProvider,SubSonic" connectionStringName="OracleDataConnection" generatedNamespace="MySqlDataDomain"/>
   </providers>
</SubSonicService>

然后SubSonic DAL,参照http://hi.baidu.com/beloving/blog/item/472d17ce1ed17e3ab600c8a9.html

注:如果同一个项目中有多个数据库,甚至是多种,如Sql Server+Oracle+MySql,建议用不同的Namespace,这样Generated目录中会出现多个相应文件夹来存放相应的数据类。

相关文章:

  • 2022-12-23
  • 2022-02-16
  • 2021-06-19
  • 2021-08-14
  • 2021-08-10
  • 2021-11-30
  • 2021-12-27
猜你喜欢
  • 2022-01-10
  • 2021-12-30
  • 2021-12-04
  • 2021-08-09
  • 2022-12-23
  • 2021-05-25
相关资源
相似解决方案