可以脱离网络运行的 .net 嵌入式数据库

发布于 2024-07-03 23:58:10 字数 680 浏览 7 评论 0原文

我曾经(现在仍然)正在寻找一个可在 .net (c#) 应用程序中使用的嵌入式数据库。 警告:应用程序(或至少是数据库)存储在网络驱动器上,但一次只能由 1 个用户使用。

现在,我的第一个想法是SQL Server Compact 版本。 这确实集成得很好,但它不能脱离网络运行。

Firebird 似乎也有同样的问题,但是.net 集成似乎并不是真正一流的,并且很大程度上没有文档记录。

Blackfish SQL 看起来很有趣,但是.net 版本没有试用版。 定价也还可以。

对于与 .net 配合良好并且无需实际安装服务器软件即可在网络上运行的任何其他建议?

I was (and still am) looking for an embedded database to be used in a .net (c#) application. The caveat: The Application (or at least the database) is stored on a Network drive, but only used by 1 user at a time.

Now, my first idea was SQL Server Compact edition. That is really nicely integreated, but it can not run off a network.

Firebird seems to have the same issue, but the .net Integration seems to be not really first-class and is largely undocumented.

Blackfish SQL looks interesting, but there is no trial of the .net Version. Pricing is also OK.

Any other suggestions of something that works well with .net and runs off a network without the need of actually installing a server software?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(11

妥活 2024-07-10 23:58:10

在阅读您的问题时,SQLite 浮现在我的脑海中,我很确定可以从网络驱动器如果您限制自己一次只能使用 1 个用户。

.NET 上的 SQLite - 获取3 分钟内启动并运行

SQLite came to my mind while reading your question, and I'm quite sure that it's possible to access it from a network drive if you keep yourself to the constraint of 1 user at a time.

SQLite on .NET - Get up and running in 3 minutes

余生再见 2024-07-10 23:58:10

我推荐 Advantage Database Server (www.advantagedatabase.com)。 它是一个成熟的嵌入式数据库,具有强大的支持,并且可以通过除 .NET 之外的许多开发语言进行访问。 “本地”版本是免费的,以 DLL 的形式在您的应用程序中运行,无需在服务器/网络共享上安装,并且支持所有主要的数据库功能。 您可以将数据库和/或应用程序文件全部存储在网络上; 它不关心数据在哪里。

免责声明:我是ADS研发组的工程师。 我保证,它很震撼:)

I'd recommend Advantage Database Server (www.advantagedatabase.com). It's a mature embedded DB with great support and accessible from many development languages in addition to .NET. The "local" version is free, runs within your application in the form of a DLL, requires no installation on the server/network share, and supports all major DB features. You can store the DB and/or application files all on the network; it doesn't care where the data is.

Disclaimer: I am an engineer in the ADS R&D group. I promise, it rocks :)

梦里南柯 2024-07-10 23:58:10

听起来 ADO/Access 非常适合您的需求。 它已融入 MS 堆栈中,经过充分验证,并且支持多用户。

您可以像这样以编程方式创建数据库:

Dim catalog as New ADOX.Catalog
Catalog.Create("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\server\path\to\db.mdb")

然后您可以使用标准 ADO.NET 方法与数据库交互。

It sounds like ADO/Access is perfect for your needs. It's baked into the MS stack, well seasoned, and multi-user.

You can programatically create a DB like so:

Dim catalog as New ADOX.Catalog
Catalog.Create("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\server\path\to\db.mdb")

You can then use standard ADO.NET methods to interact with the database.

伴梦长久 2024-07-10 23:58:10

您可以使用嵌入的 firebird,它只是您需要随应用程序一起提供的 dll。

关于未记录的事情,这不是真的,firebird .NET 驱动程序实现了 ADO 接口,因此如果您了解 ADO,您可以使用 Firebird,基本上您将使用 FBConnection 而不是 SQLConnection 等,但我的建议是编写一个数据访问层并仅在代码上使用接口,如下所示:

using FirebirdSql.Data.FirebirdClient;

public static IDbConnection MyConnection()
{
    FbConnection cn = new FbConnection("...");
    return cn;
}

这个示例非常简单,但您不需要更多。

我们的所有应用程序都使用 firebird,没有任何问题,您至少应该尝试一下。

You can use the firebird embeded, it's just a dll that you will need to ship with you app.

About things being undocumented, that's not really true, the firebird .NET driver implements the ADO Interfaces, so if you know ADO you can work with Firebird, basically instead of SQLConnection you will use FBConnection and so on, but my advice is to write a data access layer and use just interfaces on your code, something like this:

using FirebirdSql.Data.FirebirdClient;

public static IDbConnection MyConnection()
{
    FbConnection cn = new FbConnection("...");
    return cn;
}

This example is very simple, but you will not need much more than that.

We use firebird for our all application without any problems, you should at least try it out.

年华零落成诗 2024-07-10 23:58:10

查看 VistaDB。 他们有一个非常好的产品,服务器版本(3.4)处于测试阶段并且非常接近发布。

Check out VistaDB. They have a very good product, the server version (3.4) is in Beta and is very close to release.

似狗非友 2024-07-10 23:58:10

这里的帖子有点晚了..并且已经提到了 VistaDB ,但我想指出VistaDB 是 100% 托管的(因为您的帖子被标记为 .net)。 它可以从共享网络驱动器运行,并且部署了 1MB xcopy。

既然您提到了 SQL CE,我们还支持 T-SQL 语法和数据类型(实际上比 SQL CE 还要多),并且具有可更新视图、TSQL 过程和 SQL CE 中缺少的其他功能。

A little late to the post here.. And VistaDB is already mentioned, but I wanted to point out that VistaDB is 100% managed (since your post was tagged .net). It can run from a shared network drive, and is 1MB xcopy deployed.

Since you mention SQL CE, we also support T-SQL Syntax and datatypes (in fact more than SQL CE) and have updateable views, TSQL Procs and other things missing in SQL CE.

凝望流年 2024-07-10 23:58:10

为什么不使用SQL Server 2005 Express 版

这实际上取决于“嵌入式”的含义 - 但您可以将 SQLServer2005E 与您的应用程序一起重新分发,并且用户永远不必知道它的存在。

在应用程序中嵌入 SQL Server Express

将 SQL Server Express 嵌入自定义应用程序

Why not use SQL Server 2005 Express edition?

It really depends on what you mean by "embedded" - but you can redistribute SQLServer2005E with your applications and the user never has to know it's there.

Embedding SQL Server Express in Applications

Embedding SQL Server Express into Custom Applications

起风了 2024-07-10 23:58:10

我很困惑。

您需要一个嵌入式数据库 - 数据库本身存储在服务器上。 这意味着将数据文件存储在网络共享上。 然后你说 SQL Compact Edition 无法工作...除了如果有人查看此文档:

Word 文档:
在 SQL Server 2005 Compact 之间进行选择版本和 SQL Server 2005 Express 版本

在第 8 页上,“网络共享上的数据文件存储”旁边有一个漂亮的绿色大勾号。

所以在我看来你的第一个想法是正确的。

I'm puzzled.

You're asking for an embeded database - where the database itself is stored on the server. that translates to storing the data file on a network share. You then say that SQL Compact Edition won't work... except that if one looks at this document:

Word Document:
Choosing Between SQL Server 2005 Compact Edition and SQL Server 2005 Express Edition

On page 8 you have a nice big green tick next to "Data file storage on a network share".

So it seems to me that your first thought was the right one.

抱着落日 2024-07-10 23:58:10

还有瓦伦蒂娜。 当我从事一些 Real Basic 项目时,我发现了这个产品。 RB版本非常好。

There's also Valentina. I cam e across this product when I was working on some Real Basic project. The RB version is very good.

你的背包 2024-07-10 23:58:10

您考虑过 OODB 吗? 从各种开源替代方案中,我推荐 db4o (抱歉自我推销:))它可以运行嵌入式或在客户端/服务器模式下。

最佳

阿德里亚诺

Have you considered an OODB? From the various open sources alternatives I recommend db4o (sorry for the self promotion :)) which can run either embedded or in client/server mode.

Best

Adriano

空城仅有旧梦在 2024-07-10 23:58:10

这个问题现在已经很古老了,而且已经发生了很多变化。 出于我的特定目的,LiteDB 是首选选项。 它是开源的,并且有一个 GitHub 存储库

除此之外,SQLite 基本上是嵌入式数据库的行业标准。 有人尝试将代码移植到 .NET,但主要用例涉及本机库(例如 sqlite Nuget 包)和/或 .NET P/Invoke 包装器,例如 Microsoft.Data.SQLite

This question is now ancient, and a lot has changed. For my specific purposes, LiteDB is the option of choice. It's open source and has a GitHub Repository.

Apart from that, SQLite is basically the industry standard for embedded databases. There are attempts to port the code to .NET, but the prime use case involves a native library (e.g., the sqlite Nuget package) and/or a .NET P/Invoke wrapper like Microsoft.Data.SQLite.

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