简体   繁体   English

C#桌面应用程序的非常简单的基本db文件

[英]Very basic and simple db file for C# desktop app

I realize this might be a stupid question, but my GoogleFu seems to be letting me down here. 我意识到这可能是一个愚蠢的问题,但是我的GoogleFu似乎让我失望了。

I'm writing a very simple little app for myself, but I want to be able to store some data to a db file. 我正在为自己编写一个非常简单的小应用程序,但是我希望能够将一些数据存储到db文件中。 Currently I'm using SQLite and although it works I would like something even simpler if possible which does not require me to create tables and columns before hand. 目前,我正在使用SQLite,尽管它可以工作,但我希望尽可能简化一些事情,不需要我先创建表和列。 Also, for some reason the SQLite takes it's sweet time when making the first connection on app startup. 另外,由于某些原因,SQLite在应用程序启动时进行首次连接时会花费很多时间。 I've not been able to figure out why and it's becoming somewhat tiresome to have to wait 30-60sec for the first connection and that's with it on an SSD. 我一直无法弄清楚为什么,必须等待30-60秒才能进行首次连接,这变得有些烦人,而且在SSD上也是如此。 After that first connection it's perfectly fine and responsive. 第一次连接后,它就很好而且响应迅速。 But I'm getting off topic... 但是我要离开话题了...

I found db4o and that seemed like it was what I wanted, but it seems that project is dead. 我找到了db4o,这似乎是我想要的,但似乎该项目已死。 I just want the simplest and most basic option that will give me some database like capabilities where I can Insert, Update, and Delete records. 我只想要最简单,最基本的选项,它将为我提供一些数据库功能,使我可以插入,更新和删除记录。

Any suggestions? 有什么建议么?

Honestly, the best suggestion I could make is to figure out the latency issue you're having with SQLite and continue using it. 老实说,我能提出的最好建议是找出SQLite遇到的延迟问题,然后继续使用它。 There are other options to be sure, but SQLite is a very elegant solution to local data storage. 还有其他选项可以确定,但是SQLite是本地数据存储的非常优雅的解决方案。

That said, if you're insisting on something different but don't want flat-file, I guess you could try xBase 也就是说,如果您坚持使用其他内容但又不想使用平面文件,我想您可以尝试使用xBase

Thanks for the responses. 感谢您的答复。 I ended up just serializing my C# object to XML and dumping that to a text file every time a change is made to the object. 我最终只是将C#对象序列化为XML,并在每次对该对象进行更改时将其转储到文本文件中。 Then at app startup I just read the text and deserialize the XML back into an object. 然后在应用程序启动时,我只是阅读文本并将XML反序列化为一个对象。

This way I can add or change the object's definition with ease while I develop the application and don't need to create or update any tables or columns like I had to with a SQLite DB. 这样,在开发应用程序时,我可以轻松地添加或更改对象的定义,而无需像我使用SQLite DB那样创建或更新任何表或列。 I also don't have any dependencies other than .net 4.0. 除了.net 4.0,我也没有任何依赖项。

If I was going to store something like Client Info on a crappy desktop application then I would use SQLite as the data would have some importance. 如果我要在一个笨拙的桌面应用程序上存储诸如“客户端信息”之类的内容,那么我将使用SQLite,因为数据具有某些重要性。

I'm just storing a list of url's (Along with some other data) that can easily be replaced if the data were to be lost. 我只是存储url列表(以及其他一些数据),如果数据丢失,可以轻松替换。

I do mostly front end dev work and some MS SQL. 我主要从事前端开发工作和一些MS SQL。 As such my knowledge with database tech in general kinda sucks, so I've learned about some other DB tech. 像这样,我对数据库技术的了解通常很烂,因此我了解了其他一些DB技术。

Thanks Again 再次感谢

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM