WPF 应用程序的最佳本地数据库解决方案是什么?

发布于 2024-07-23 08:23:29 字数 1028 浏览 3 评论 0原文

对于要在一台计算机上使用、不同用户登录并使用它们在本地获取/保存信息的 WPF 应用程序,当前的最佳解决方案是什么? 以下是我对选项的看法:

  • MDF 似乎是最佳选择,因为我假设您可以很好地锁定它,这样即使用户可以访问 .mdf 文件,他们仍然无法访问除了通过应用程序本身之外,不能访问其中的数据。 我假设 .MDF 文件必须与应用程序分开存在,因此将部署 .exe 和 .mdf 文件。 哦,如果您使用 .MDF 文件,用户是否需要安装 SQL Server 才能使用它在此 stackoverflow 问题中指出

  • 我认为SDF不会被推荐,因为它有很多限制并且主要用于移动存储。

  • XML 如果安全性不重要,则可能是合适的,例如一个小型的单用户应用程序,用于在本地保存数据,而他无论如何都不会保护该数据,并且其他人可以轻松访问该文件计算机上的应用程序/网站。

  • SQLite 可能是一个选择,但据我所知,该数据库的 .NET API 还不够强大,不是吗?

  • .mdb 如果您还需要用户使用 Access 编辑/查看数据或生成报告,则 Access 可能是一个选择。

  • 还有IsolatedStorage,但我相信这有严重的限制,不是吗,例如无法从其他应用程序访问它?

  • 也许使用云服务现在可能是可行且非常简单的,必须进行调查

感谢任何反馈或想法。

What is currently the best solution for WPF applications which are meant to be used on one computer where various users log into them and use them to get/save information locally? Here's how I see the options:

  • MDF would seem to be the best choice since I assume you can lock it down quite well so that even though users can access the .mdf file, they still couldn't access the data in it except through the application itself. I assume the .MDF file would have to exist separately from the application so would deploy the .exe and the .mdf file. Oh, if you use an .MDF file, does the user need SQL Server installed to use it as is indicated in this stackoverflow question?

  • I would think SDF wouldn't be recommended since it has quite a bit of limitations and used mainly for mobile storage.

  • XML might be appropriate if security didn't matter, e.g. a small one-user application to save data that locally that he wouldn't secure anyway, and this file would be easily accessed by other applications/websites on the computer.

  • SQLite might be a choice but from what I know the APIs for .NET for this database aren't that robust yet, are they?

  • .mdb Access might be a choice if you needed users to also edit/view the data or generate reports with Access.

  • there is also IsolatedStorage but I believe this has serious limitations, doesn't it, e.g. not able to access it from other applications?

  • perhaps using a cloud service might be feasible and quite straight-forward nowadays, would have to investigate

Would appreciate any feedback or ideas.

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

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

发布评论

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

评论(5

无远思近则忧 2024-07-30 08:23:29

SQL Server Compact 版本也是一个选项 - http://www.microsoft。 com/Sqlserver/2005/en/us/compact.aspx

使用 ClickOnce 或将引擎 dll 复制到应用程序目录,部署非常容易。

SQL Server Compact edition is also an option - http://www.microsoft.com/Sqlserver/2005/en/us/compact.aspx

Deployment is pretty easy using ClickOnce or by copying the engine dlls to the application directory.

暖心男生 2024-07-30 08:23:29

我会选择 SQLite。 您可以在此处获取 ADO.NET 兼容驱动程序:

System.Data.SQLite

I would choose SQLite. You can get the ADO.NET Compatible driver here:

System.Data.SQLite

西瑶 2024-07-30 08:23:29

我会说 SQLite。 它非常轻量且易于使用,而且 API 也很好。 您始终可以使用 DbLinq 作为 ORM。

I'd say SQLite. It's incredibly light-weight and easy to use, and the API is fine. You could always use DbLinq as ORM.

浸婚纱 2024-07-30 08:23:29

我选择 SQL Server Compact 版本是因为它具有以下优点:

  • 可以与应用程序一起分发的小型运行时库
  • 与 Linq to Sql 兼容(搜索“SqlMetal.exe”)
  • 与 Visual Studio 2008 集成设计体验

这是一个很好的全能工具.NET 应用程序的轻量级解决方案。

http://www.microsoft.com/Sqlserver/2008/en/我们/compact.aspx

SQL Server Compact edition is my choice because of the following benefits:

  • A small runtime library that you can distribute with your app
  • Compatible with Linq to Sql (search "SqlMetal.exe")
  • Integrated design experience with Visual Studio 2008

It's a nice all rounder as a lightweight solution for a .NET app.

http://www.microsoft.com/Sqlserver/2008/en/us/compact.aspx

GRAY°灰色天空 2024-07-30 08:23:29

MDF 似乎确实是最灵活的解决方案,但用户需要安装 SQL Server Express 才能使用它。

您计划如何执行 CRUD 流程? 如果您想使用 Linq to SQL,您会受到官方的限制,它仅支持 SQL 2005、Sql 2008 和 Sql Compact。

另外,应用程序是否需要断开、部分或完全连接到互联网? 这可能会给你的决定带来一些影响。

在我看来,我会从 SQL Server Compact 版本开始,如果这限制太多,我会转向 sql server express。 (.MDF)

MDF does seem to be the most flexible solution but user need to have SQL server express installed to use it.

How do you plan on executing CRUD processes? If you are wanting to use Linq to SQL you are kinda limited offically it only supports SQL 2005, Sql 2008 and Sql Compact.

Also, does the application need to be disconnect, partially, fully connected to the internet? That may put some weight on your decision.

IMO, I would start with SQL Server Compact edition and if that was too limiting move to sql server express. (.MDF)

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