简体   繁体   English

有关将数据库集成到我的C#Winforms应用程序中的更多信息?

[英]More Information about integrating a database into my C# Winforms Application?

I've used databases in asp.net but I now have a situation where I need the power/flexibility of a database but I need to ship it with my application. 我已经在asp.net中使用数据库,但是现在我需要一个数据库的功能/灵活性,但是我需要将其与应用程序一起交付。 I need to access my tables and create new ones etc but without requiring the user to have any kind of database software installed. 我需要访问我的表并创建新的表等,但不需要用户安装任何类型的数据库软件。 Ie I want it to be self-sufficient. 即我希望它能自给自足。 What are my options? 我有什么选择? Of course standard serialization could be used but I want to use an actual database technology for cases where the records are in the tens of thousands. 当然可以使用标准的序列化,但是对于成千上万的记录,我想使用一种实际的数据库技术。

Thanks for any input! 感谢您的任何意见!

You're probably looking at some sort of embedded / in-process database. 您可能正在查看某种嵌入式/进程内数据库。 Microsoft espouses their lite version of SQL Server. Microsoft拥护其精简版SQL Server。 My personal recommendation is to look at SQLite. 我个人的建议是看一下SQLite。 SQLite leaves you with a single DLL to run the database and one file for the actual db data. SQLite为您提供了一个用于运行数据库的DLL和一个用于实际数据库数据的文件。

The System.Data.SQLite project is an awesome community contribution to bridge the gap between SQLite and what .NET developers have come to expect with commerical database integration. System.Data.SQLite项目是社区的杰出贡献,旨在弥合SQLite与.NET开发人员对商业数据库集成的期望之间的鸿沟。 With this project you get a driver with full ADO.NET 2.0 support, ADO.NET Entity Framework support and Visual Studio database design time integration. 通过该项目,您将获得具有完全ADO.NET 2.0支持,ADO.NET实体框架支持和Visual Studio数据库设计时集成的驱动程序。

Give it a look. 看看吧。 You'll be up and running in no time and I'm sure you'll be impressed. 您将立即启动并运行,我相信您会印象深刻。

There is a good series of articles regarding SQLLite here: 这里有很多有关SQLLite的文章:

http://www.csharphacker.com/technicalblog/index.php/2009/06/16/sqlite-for-c-part-1-am-i-allowed-to-use-it/ http://www.csharphacker.com/technicalblog/index.php/2009/06/16/sqlite-for-c-part-1-am-i-allowed-to-use-it/

the remaining 6 articles are posted at the bottom of this page 其余6条文章发布在此页底部

You could use Sql Express or Sql Compact if the database is user specific. 如果数据库是特定于用户的,则可以使用Sql ExpressSql Compact If the database is shared between users you can still use Sql Express, but then you're stuck deploying a separate server installer. 如果数据库在用户之间共享,您仍然可以使用Sql Express,但是您将无法部署单独的服务器安装程序。

Sounds like you want an in-process database. 听起来像您想要一个进程内数据库。 Look at SQLLite or MS SQLCE. 查看SQLLite或MS SQLCE。

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

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