简体   繁体   English

C#Winforms作为访问的前端

[英]C# winforms as front-end for access

I'm in the early stages of building a winform C# app based on Access db (can't use other types of DB for different reasons). 我正处于基于Access db构建Winform C#应用程序的早期阶段(出于不同的原因,不能使用其他类型的DB)。 My main issue is how to design the DB since the amount of data is vast (based on daily data) and it will fill up the its size limit within a month or so. 我的主要问题是如何设计数据库,因为数据量巨大(基于每日数据),并且它将在一个月左右的时间内填满其大小限制。 I thought of creating a new DB for every month, but how will I be able to compare data between the different DB, for example, between months? 我曾想为每个月创建一个新的数据库,但是如何才能比较不同数据库之间的数据,例如,几个月之间的数据呢? I want the C# app to execute the queries. 我希望C#应用程序执行查询。 Are there any tutorials, books? 有教程,书籍吗? I have no experience of using and linking front and back-end Access. 我没有使用和链接前端和后端Access的经验。

Any ideas? 有任何想法吗? Thanks! 谢谢!

You probably don't want to hear this, but starting a project with MS Access as the backend is not a good idea when you already know in advance that you will hit Access' size limit after only a month. 您可能不希望听到此消息,但是如果事先知道您将在一个月后达到Access的大小限制,那么以MS Access作为后端启动项目并不是一个好主意。

You say in a comment: 您在评论中说:

I'm stuck with Access because of these: 1. High cost of SQL server. 由于以下原因,我无法使用Access:1. SQL Server的高成本。 2. I'm not familiar with SQL server. 2.我对SQL Server不熟悉。 3. SQL server express (the free edition) also has a size limit, though larger (10gb). 3. SQL Server Express(免费版)也有大小限制,尽管更大(10gb)。 Are there other DB free and without size limitation? 是否有其他免费且没有大小限制的数据库? Are there other DB free 是否有其他免费的数据库

I agree with you that SQL Server is not a good solution in your situation - high price and size limitation are valid arguments against SQL Server (both full version and Express Edition). 我同意您的观点,SQL Server并不是一个好的解决方案-高价格和大小限制是对SQL Server(完整版和Express Edition)的有效论据。

So, in my opinion using a different database engine is the only real solution here. 因此,我认为使用唯一的数据库引擎是这里唯一的真正解决方案。
Your third argument against SQL Server was "I'm not familiar with it", but I strongly advise you to become familiar with another database engine than Access, because using Access in your situation (size limit!!!) will be a pain in the long run. 您对SQL Server第三个理由是:“我不熟悉”,但我强烈建议你熟悉比访问其它数据库引擎,因为在你的情况(大小限制!!!)使用Access将是一个痛苦从长远来看。
(Note to all nitpickers: No, I'm not bashing Access in general - I'm making a living with it myself. (所有nitpickers的注意事项:不,我一般不抨击Access-我自己以此为生。
However, it has its limits and when you know in advance that you'll hit its size limit within a month, it's not a good idea to use it here.) 但是,它有其局限性,当您提前知道您将在一个月内达到其大小限制时,在此处使用它不是一个好主意。)

Yes, you could do some hack and use a different Access database for each month, but you will really feel the pain as soon as your users will need to load data from several months at once, or as soon as your boss asks you for a "quick report about our sales in the last three years" :-) 是的,您可以每月进行一些破解并使用不同的Access数据库,但是一旦您的用户需要一次加载几个月后的数据,或者您的老板要求您一次加载数据,您就会感到非常痛苦。 “关于最近三年我们的销售的快速报告” :-)

But you can use a different database engine. 但是您可以使用其他数据库引擎。 Yes, you will have to invest time to become familiar with it, learn how to set it up and so on. 是的,您将需要花费时间来熟悉它,学习如何设置它,等等。
But believe me, it will pay off in the long run because you don't have to deal with the hassle of one database file per month. 但是请相信我,从长远来看,它会有所回报,因为您不必每月处理一个数据库文件的麻烦。

There are lots of free and capable database engines available, the most known are: 有许多免费且功能强大的数据库引擎可用,最著名的是:

To connect to the MS Access database(s) you can use the code shown here and then you can go about 'joining' the data in your C# front-end. 要连接到MS Access数据库,可以使用此处显示的代码,然后可以在C#前端中“联接”数据。

You might end up writing a subset of a DB engine in C# though and I thoroughly support the comments provided by Bernard and Bryan. 但是,您可能最终会用C#编写数据库引擎的子集,而我完全支持Bernard和Bryan提供的注释。

Your DB design should be isolated from your front-end technology decisions, and the reverse is also true. 您的数据库设计应与您的前端技术决策区分开来,反之亦然。 See Multitier Architecture . 请参阅多层体系结构

Using a multi-tier architecture will help you separate presentation from business logic from data access, allowing you to design and implement each of these components in a modular and robust fashion. 使用多层体系结构将帮助您将表示形式与业务逻辑与数据访问分开,从而允许您以模块化和健壮的方式设计和实现这些组件。

来自webopedia的图表

Searches for N-Tier architecture or Multitier architecture will find a wealth of information and help on how to implement multi-tier solutions and why you should go to the trouble. 搜索N层体系结构或多层体系结构将发现大量信息,并有助于实现多层解决方案以及为什么要麻烦一下。

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

相关问题 我应该写一个访问前端或c#前端吗? - should i write an access front end or c# front end? Windows应用商店 - HTML5中的前端和C#/ C ++中的后端 - Windows store applications - Front-end in HTML5 and Back-end in C#/C++ 不同VS解决方案中的Angular前端和C#后端 - Angular front-end and C# back-end in different VS solution 加载集线器时出错。 HTML5 / js前端和C#后端 - Error loading hubs. HTML5/js front-end and C# back-end 用C#前端和Java后端编程:好的还是坏的做法? - Program with C# front-end and Java back-end: Good or Bad Practice? 如何将对象数组从 Angular 前端传递到 C# 后端 - How to pass Array of Objects from Angular Front-end to C# Back-end 在c#后端调用api时角度前端获取错误 - Angular front-end getting error when calling api on c# back-end C#前端GUI调用Linux C ++函数 - c# front-end GUI calling linux C++ functions XAML前端中的内联c#:为什么在XAML中不起作用? - Inline c# in XAML front-end: Why doesn't this work in XAML? c# datatablejs 服务器端禁用列可用于服务器端但不能用于前端 - c# datatablejs server-side disable column orderable for server-side but not for front-end
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM