带有数据库的c#.net中的Windows窗体 [英] Windows form in c#.net with database

查看:84
本文介绍了带有数据库的c#.net中的Windows窗体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一个建议。

我想开发一个带有数据库的Windows桌面应用程序。

我应该使用哪个数据库,以便我可以在这期间简单地安装该数据库安装该应用程序?



我尝试过:



之前我使用Oracle数据库开发了一个Windows应用程序,但在这种情况下我需要在相应的系统中安装oracle数据库来运行该应用程序。

I need a suggestion.
I want to develop a windows desktop application with database.
which database should I use ,so that I can simple install that database during installation of that application ?

What I have tried:

Previously i developed a windows application by using Oracle database but in that case i need to install oracle database in respective system to run that application.

推荐答案

最简单的方法可能是使用您需要的表和关系创建DataSet并将数据存储在XML文件中。



这不需要额外的安装,并且您没有依赖于第三个派对系统。



您可以像创建数据库一样创建数据集架构,使用LINQ,您可以以类似于以下方式查询数据集:好吧。

创建数据集 [ ^ ]

LINQ to DataSet中的查询 [ ^ ]



关于数据集的一个注意事项是所有数据都加载到内存中,所以如果你有很多数据你必须要注意这一点。





另一个选择是SQLite。请参见 SQLite主页 [ ^ ]

SQLite是一个基于文件的SQL数据库,安装在本地,不需要服务器。

(我必须承认我没有还没试过SQLite。只是自己下载了,我即将开始一个小项目。)
The easiest way would probably be to create a DataSet with the tables and relations you need and store the data in an XML file.

This requires no extra installation at all and you have no dependencies to third party systems.

You can create a data set schema in the same way as you create a database, and with LINQ you can query the data set in a similar way as well.
Creating a DataSet[^]
Queries in LINQ to DataSet[^]

One note about data sets are that all the data is loaded in memory, so if you have a lot of data you have to beware of this.


One other option is SQLite. See SQLite Home Page[^]
SQLite is a file based SQL database that is installed locally and requires no server.
(I have to confess I have not yet tried SQLite out yet. Just downloaded it myself, and am about to start a little project.)


这篇关于带有数据库的c#.net中的Windows窗体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆