简体   繁体   English

使用C#为简单数据库创建前端

[英]Using C# to create a frontend for a simple database

I've only used C# to create console apps up to now. 到目前为止,我只使用C#创建控制台应用程序。 What I would like to do next is create ac# application that could open a one table database (probably sqlite) and present the data in table form to the user. 我接下来要做的是创建ac#应用程序,它可以打开一个表数据库(可能是sqlite)并以表格形式向用户显示数据。 I'd like the user to be able to do things like sort by column, search etc. I have a couple of questions with regards to the GUI piece. 我希望用户能够按列,搜索等方式进行排序。我对GUI文件有几个问题。

What would be the appropriate .Net technology to use for the GUI front end? 什么是适用于GUI前端的.Net技术? WinForms? 的WinForms?

I would really appreciate a link to a tutorial or worked example of doing something similar 我真的很感激链接到教程或做类似的事情的工作示例

Any help appreciated. 任何帮助赞赏。

This tutorial shows you how to create a DataGridView , load database values in it. 本教程将向您展示如何创建DataGridView ,在其中加载数据库值。 The sorting is an automatic property of the DataGridView. 排序是DataGridView的自动属性。 The DataGridView is a control used in a WinForms application, which seems the best solution for your needs. DataGridView是WinForms应用程序中使用的控件,它似乎是满足您需求的最佳解决方案。

如果您正在寻找RAD无通用解决方案,请使用带有winforms的GRIDVIEW,如果您正在寻找通用且灵活的解决方案,我喜欢本教程

In your situation I would start with WinForms as GUI technology - simpler and more mature than WPF. 在您的情况下,我将从WinForms开始作为GUI技术 - 比WPF更简单,更成熟。

Here 这里

http://www.codeproject.com/KB/cs/SQLiteCSharp.aspx http://www.codeproject.com/KB/cs/SQLiteCSharp.aspx

you find an example application for a single table SqlLite DB. 您找到单个表SqlLite DB的示例应用程序。

I would go for WinForms for the first application. 我会为第一个应用程序选择WinForms。 To display your data I'd use a DataGrid which I would feed a DataTable filled with the query result. 为了显示您的数据,我将使用DataGrid,我将提供填充查询结果的DataTable。 The Grid and the Table have standard sort functionality built in. Grid和Table具有内置的标准排序功能。

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

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