用C#和sql server创建一个exe项目 [英] creat an exe project with C# and sql server

查看:93
本文介绍了用C#和sql server创建一个exe项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

各个团体

i第一次使用C#和SQL server完成项目Windows窗体应用程序。但我想为另一台安装的计算机构建exe文件。

i使用Sql server Express,请帮我创建它。

谢谢你

hi every body
i finish for first time a project windows form application with C# and SQL server.but i want to build exe file for another computer that install .
i use Sql server Express,please help me to creat it.
thank you

推荐答案

你不想要一个EXE文件,你想要的安装包。这将确保安装必要的必备条件,例如适当的.NET版本以及应用程序exe文件等。尝试在解决方案中创建一个新项目:Visual Studio项目模板的其他项目类型分支中的设置和部署。



但是......

您不应在安装中包含SQL Server。有几个原因:

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

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

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

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

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

5)它将破坏使用Sql Server而不是SqlCE或SQLite的主要优势 - 多用户访问。如果每个人都安装了自己的SQL服务器副本,那么您将拥有数据库的多个副本,每个副本由一个人使用。这会引起一些混乱,并且(取决于你如何编写原始数据库)可能需要花费相当大的努力才能在问题实现时组合成单个实例。
You don't want an EXE file, you want an installation package. That will ensure that the necessary requisites such as the appropriate .NET version is installed as well as the application exe file and so forth. Try creating a new project in your solution: a "Setup and Deployment" from the "Other Project Types" branch of the Visual Studio project templates.

But...
You should not include SQL Server in your installation. 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.


你可以遵循这个第一次开发的文章

试试这个:

http://www.c-sharpcorner.com/UploadFile/deepak.sharma00/how-to-create-an-installer-for -a-winform-application-using-s / [ ^ ]



http://www.c-sharpcorner.com/UploadFile/rahul4_saxena/Setup08232007071849AM/Setup.aspx [ ^ ]



赢取表格项目部署VS2012 [ ^ ]



http://forums.asp.net/t/1886823.aspx [ ^ ]
you can follow with this articles for your first development
try this:
http://www.c-sharpcorner.com/UploadFile/deepak.sharma00/how-to-create-an-installer-for-a-winform-application-using-s/[^]

http://www.c-sharpcorner.com/UploadFile/rahul4_saxena/Setup08232007071849AM/Setup.aspx[^]

Win Form Project Deployment VS2012[^]

http://forums.asp.net/t/1886823.aspx[^]


这篇关于用C#和sql server创建一个exe项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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