通过通用代码使用多个数据库

发布于 2024-08-30 08:29:01 字数 143 浏览 5 评论 0原文

我只是希望能够根据用户的选择存储和访问 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦里人 2024-09-06 08:29:01

NHibernateSubSonic 可以与不同类型的数据库通信,但它们可能不支持您列出的所有数据库(特别是 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文