在使用数据库创建应用程序时,我对最佳实践和方法有一些疑问? [英] I have some questions about best practices and way when creating application with database?

查看:79
本文介绍了在使用数据库创建应用程序时,我对最佳实践和方法有一些疑问?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我对使用数据库创建应用程序时的最佳实践和方法有一些疑问,其中一些问题可能看起来很愚蠢,但我需要了解这些想法:



1.当我使用数据库创建应用程序并在部署之后,当我在新PC上安装它时,必须在新PC上正常工作吗?



2.如果没有部署,如何在安装程序时解决安装SQL Server和安装数据库的问题?



3.当我用数据库创建应用程序时,数据库是否与应用程序一起部署?



4.当我创建应用程序时,如果我使用连接字符串它会有静态信息,但这个信息在另一台PC上会有所不同,对吗?如果是,如何解决这个问题?



5.如何在启动程序时检查数据库的存在和连接?



6.如何保护课堂上保存的信息不容易访问?

Hello, I have some questions about best practices and way when creating application with database, some of these questions may look stupid but I need to get the ideas:

1. when I create application with database and after deploying it, when I install it on new PC what must be on the the new PC to work normally on it?

2. If it is not deployed, how to solve the problem of installing SQL Server and making database installed while installing the program?

3. when I create application with database did the database deployed with the application?

4. while I am creating the application, if I use the connection string it will have static information, but this info will be different on the other PC, right? If yes, how to solve this problem?

5. How can I check the database existence and connection when I starting up my program?

6. How to secure information saved in class where they are not accessible easily?

推荐答案

1 。最小的是应用程序exe文件和数据库(假设您正在设置本地数据库而不访问服务器上的共享数据库。通常,您将有其他dll和配置文件。



2.有安装程序包可以解决这个问题。谷歌周围你会找到一些解决方案.Visual studio有基本的安装项目模板。



3.数据库部署:通常通过脚本编写,如果它们是安装包的一部分。如果你手动设置它,最快的方法是备份空数据库(包括所有相关信息,如查找),简单地将其恢复到新安装



4.不,它不必是不同的。您可以使用localhost或。引用本地数据库。



5.尝试连接并检查结果异常。例如,您可以在小表中获得许可证检索和/或程序版本。查询结果将是a)否C onnection或b)检查有效性的信息。



6.您可以将关键信息保存到数据库中加密。你甚至可以将它保存在配置文件中,但它更容易获得(但不能破解)。或者您可以拥有自己的服务器,并且需要访问Internet才能进行许可证验证(在这种情况下,没有任何没有Internet访问权限的人可以使用您的程序直到签良好的设计允许一段时间不经过首次检查后检查,甚至允许单次检查。
1. Minimum is application exe file and the database (assuming you're setting up local database and not accessing shared one on the server. Commonly, you will have additional dlls and config files.

2. There are installer packages that can take care of that. Google around and you'll find some solution. Visual studio has rudimentary setup project template.

3. Database deployment: commonly via scripts prepared if they are parts of setup package. If you're setting it up manually, fastest way is to have a backup copy of empty database (with all relevant information in, such as lookups) and simply restore it to new installation

4. No, it doesn't have to be different. You can reference local database with localhost or ".".

5. Try to connect and check the resultant exception. You could for example have license retrieval and/or program version in a small table. The result of the query will be a) no connection or b) information to check for validity.

6. You could save critical information into the database encrypted. You could even save it in a config file, but it would be easier to get (but not to crack). Or you could have your own server and require internet access for license validation (in which case no one without internet access could use your program until checked). Good design would allow for some time without checking after first check or even allow for single check.


这篇关于在使用数据库创建应用程序时,我对最佳实践和方法有一些疑问?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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