以c#windows形式在另一台PC上安装 [英] Installation on another PC in c# windows form

查看:59
本文介绍了以c#windows形式在另一台PC上安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个Windows窗体并使用SQL 2008,我的问题是 - 如果我创建一个安装文件,如果我将它安装到另一台计算机,那么我需要在该计算机上安装SQL吗?你可以告诉我我的应用程序将如何运行。

I have created a windows form and using SQL 2008, my question is - if i create a setup file and if i install it to another computer then will i need to install SQL on that computer? can u please tell me how my application will run .

推荐答案

你不应该在另一台PC上安装SQL服务器。

有一个几个原因:

0)您只能出于版权原因分发SQL Server Express - 而不是SQL Server完整版。

1)他们可能已经安装了SQL Server网络。如果是这样,那么他们可能会想要使用该版本。

2)如果他们确实安装了SQL服务器并且你开始扩散SQL服务器Express实例,那么你将会惹恼数据库管理员...

3)SQl Server的单站点安装比用户控制下的一些分散版本更有可能被备份。

4)对于普通用户来说,安装和管理Sql服务器非常复杂 - 这不是一个好主意!

5)它将破坏使用Sql Server而不是SqlCE或SQLite的主要优势 - 多用户访问。如果每个人都安装了自己的SQL服务器副本,那么您将拥有数据库的多个副本,每个副本由一个人使用。这会引起一些混乱,并且(取决于你如何编写原始数据库)在实现问题时可能需要付出相当大的努力才能组合成单个实例。





您应该编写应用程序,以便从配置文件加载SQL的连接字符串 - 我假设您已经这样做了?因为如果您已将硬编码到应用程序中,则必须为每次安装更改字符串...
Your shouldn't install SQL server on another PC.
There are a couple of reasons:
0) You can only distribute SQL Server Express for copyright reasons - not SQL Server full version.
1) They may already have SQL Server installed on the network. If so, then they will presumably want to use that version.
2) If they do have SQL server installed and you start proliferating SQL server Express instances, you are going to annoy the heck out of the database administrator...
3) A single site installation of SQl Server is a lot more likely to be backed up than a number of scattered version under user control.
4) Sql server is quite complex for a "normal" user to install and administer - it is not a good idea!
5) It will destroy the primary advantage of using Sql Server over SqlCE or SQLite - multiuser access. If everyone installs their own copy of SQL server, then you will have multiple copies of your database, each used by a single person. This will cause some confusion, and (depending on how you wrote the original database) may take some considerable effort to combine into a single instance when the problem is realized.


You should have written your application so that it loads the connection string for SQL from a configuration file - I assume you have done this? Because if you have hard coded it into your app, you will have to change the string for every installation...


这取决于您要执行的操作。选项:

1-目标计算机可能是隔离的。然后,你必须在那台机器上安装sql server。

2-你的应用程序可能在连接到网络的计算机上运行。然后你可以选择一台计算机作为你的sql server主机,其他人可以连接它。


每种情况下
,你的 SqlConnection 需要一个到sql server的连接字符串。最好将该连接字符串保存在应用程序配置文件中。
It depends on what you want to do. options:
1- target computer may be isolated. then, you have to install sql server on that machine.
2- your application may run on computers connected to a network. then you can select one computer as your sql server host machine and others can connect it.

in each case, your SqlConnection needs a connection string to the sql server. it is better to save that connection string in the application configuration file.


这篇关于以c#windows形式在另一台PC上安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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