The following articles mainly describe the correct configuration scheme for connecting to the MySQL database using SubSonic. With the wide application of the MySQL database, the related applications are also paid attention, the following articles mainly introduce the correct configuration scheme for connecting to the MySQL database using SubSonic.
Add SubSonic. dll references to the project;
Add
- <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>
Then SubSonic DAL, refer to http://hi.baidu.com/beloving/blog/item/472d17ce1ed17e3ab600c8a9.html
NOTE: If there are multiple databases or even multiple types of databases in the same project, such as SQL Server + Oracle + MySQL, different namespaces are recommended, in this way, multiple corresponding folders will appear in the Generated directory to store the corresponding data classes.
The above content describes how to use SubSonic to connect to the MySQL database configuration. I hope it will help you in this regard.