简体   繁体   English

Subsonic为简单存储库添加数据库提供程序

[英]Subsonic adding a DB provider for Simple Repository

I was wondering--what part of Subsonic 3 needs to be modified to support a different database under a Simple Repository scenario? 我在想-在简单存储库场景下需要修改Subsonic 3的哪些部分以支持其他数据库? I haven't found any documentation on this point. 在这一点上,我还没有找到任何文档。 Subsonic 3 seems to be all about the T4 templates but when I check out the Subsonic project sources I don't see any T4 templates in there...so where/how do I add support for another database? Subsonic 3似乎与T4模板有关,但是当我查看Subsonic项目源时,那里没有任何T4模板...所以我在哪里/如何添加对另一个数据库的支持?

Thanks, 谢谢,

Alex 亚历克斯

no part of SubSonic needs to be modified for SimpleRepo - just change your connection string and be sure to change the provider (part of the connection string) as well. SubSonic的任何部分都无需为SimpleRepo进行修改-只需更改您的连接字符串,并确保也更改了提供程序(连接字符串的一部分)。 So, the default connection might be: 因此,默认连接可能是:

connectionString="server=localhost;database=northwind;user id=bob;password=*****" provider="System.Data.SqlClient" connectionString =“ server = localhost; database = northwind; user id = bob; password = *****” provider =“ System.Data.SqlClient”

Change that to be the connection string you want, and the provider to your DB provider. 将其更改为所需的连接字符串,然后将提供程序更改为数据库提供程序。 MySQL would be something like "MySql.Data.MySqlClient" and SQLite would "System.Data.SQLite" (I think). MySQL将类似于“ MySql.Data.MySqlClient”,而SQLite将类似于“ System.Data.SQLite”(我认为)。

SubSonic will do the rest. SubSonic将完成其余的工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM