通过通用代码使用多个数据库
我只是希望能够根据用户的选择存储和访问 ACCESS、SQLSERVER、SQLCE、SQLLITE 中的数据。 有没有一个库可以帮助我在 C# 中完成这项工作?
我想简单地更改连接字符串而不是代码。
有什么办法吗?
谢谢。
I just want to be able to store and access data from ACCESS,SQLSERVER,SQLCE,SQLLITE based on the users choice.
Is there a SINGLE library that can help me do this job in c#?
I would like to simply change the connection string and not the code.
Is there any way for this?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
NHibernate 或 SubSonic 可以与不同类型的数据库通信,但它们可能不支持您列出的所有数据库(特别是 MS Access 似乎不受 SubSonic 支持)。如果您打算使用 NHibernate,我会看一下 Fluent NHibernate 因为它不需要映射文件NHibernate 所依赖的。我自己才刚刚开始使用它,但到目前为止看起来还不错。
NHibernate or SubSonic can talk to different types of databases, but they may not support all the databases you list (MS Access in particular doesn't seem to be supported by SubSonic). If you're going to use NHibernate, I'd take a look at Fluent NHibernate as it does away with mapping files that NHibernate depends on. I'm only just getting started with it myself, but it's looking good so far.