保留本地数据库的最简单方法
我对 C# 相当陌生,我想知道在用户的 PC 上保存数据库有哪些不同的选项。
它基本上是为了保存收藏夹并能够在每个收藏夹上添加注释,然后我就可以显示包含所有收藏夹及其注释的列表。 但老实说我不知道如何做到这一点,我已经使用过 mySQL 但我不能在这里做到这一点。
谢谢
编辑:该程序类似于互联网浏览器,但针对特定网站,因此数据库不会那么大
I'm fairly new to c# and I was wondering what different options there are for keeping a database on the user's PC.
It's basically for saving favorites and being able to add a note on each favorite, and then i'd be able to show a list with all favorites and their note.
But I honestly have no clue how to even do that, I've worked with mySQL but I can't do that here.
Thanks
Edit: The program is comparable to an internet browser but for a specific website, so it won't be that big of a database
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
SQLite 是将本地关系数据库与应用程序捆绑在一起的一种简单且常见的方法。它在 System 上有 ADO.NET(C# 数据库绑定)。 Data.SQLite。
但是,如果您只是存储一组简单的元组,那么在磁盘上保存为常规文本文件的逗号分隔列表是否可以正常工作?
SQLite is a simple and common way to bundle a local relational database with an application. It has ADO.NET (C# database bindings) at System.Data.SQLite.
However, if you're just storing a simple set of tuples, wouldn't a comma-separated list saved as a regular text file on disk work just fine?
在 .NET 中,最不烦人的路径可能是 SQL Server Compact 或 VistaDB
In .NET, the path least annoying will likely be SQL Server Compact or VistaDB
有很多这样的数据库 - Microsoft 的一个是 SQL CE。
There are many such databases - the Microsoft one is SQL CE.
听起来您不需要数据库。对于这么简单的事情,一个文件就可以了。
如果你想要一个数据库,我会看看 SQL Server Compact Edition ,或者迈克建议的 SQLite。
It doesn't sound like you need a database. For something that simple, a file would do.
If you want a database, I'd have a look at SQL Server Compact Edition, or SQLite as Mike suggests.