[英]How to create .exe file in Visual Studio 2008 and SQL Server 2012
How to create .exe
file in Visual Studio 2008 and SQL Server 2012? 如何在Visual Studio 2008和SQL Server 2012中创建
.exe
文件? I am trying to create an .exe
file for my C# Windows application, I am using microsoft SQL Server Management Studio 2012 as database. 我正在尝试为C#Windows应用程序创建一个
.exe
文件,我正在使用Microsoft SQL Server Management Studio 2012作为数据库。
Then only I can run my application in another machine also. 然后,只有我才能在另一台计算机上运行我的应用程序。
Thanks in advance... 提前致谢...
Note: You probably need to build an installer or deployment package and not just copy over the exe to another computer because there may be missing dependencies. 注意:您可能需要构建安装程序或部署程序包,而不仅仅是将exe复制到另一台计算机,因为可能缺少依赖项。
It may help you to read a "getting started in Visual Studio" tutorial. 它可以帮助您阅读“ Visual Studio入门”教程。
Cheers. 干杯。
Try http://www.codeproject.com/Articles/568476/Creating-an-MSI-Setup-Package-for-Csharp-Windows 尝试http://www.codeproject.com/Articles/568476/Creating-an-MSI-Setup-Package-for-Csharp-Windows
You cant find complete solution for make .exe. 您无法找到make .exe的完整解决方案。
We can implement auto attach database just use the connection string following. 我们可以使用下面的连接字符串来实现自动附加数据库。
1) Add a folder named ”DB” to the project, and copy the database file into it after you detach it from your sql server. 1)在项目中添加一个名为“ DB”的文件夹,然后将其与sql server分离,然后将数据库文件复制到其中。
2) Change your connection string like this: 2)像这样更改您的连接字符串:
<connectionStrings>
<add name="WindowsFormsApplication1.Properties.Settings.BabakConnectionString"
connectionString="Data Source=.;AttachDbFilename=|DataDirectory|\DB\DataBase1.mdf;Initial Catalog=test;Integrated Security=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
3) After these, the database file will auto attach to the sql server when you run your application, and the database name is “test”, you can open the sql server management studio to find it. 3)之后,运行应用程序时,数据库文件将自动附加到sql服务器,并且数据库名称为“ test”,您可以打开sql server management studio进行查找。
In addition, you can find the connection in the app.config file through the solution explorer in vs2010. 此外,您可以通过vs2010中的解决方案资源管理器在app.config文件中找到连接。 And you also can find this file under your project.
您也可以在项目下找到该文件。 With these information, you can find it and modify it.
有了这些信息,您就可以找到并修改它。
您可以在项目的工作文件夹中看到您的EXE文件。打开工作文件夹> Bin> Debug> Exe文件将存在。首先构建您的解决方案
不要让任何人傻瓜,在Visual Studio 2013和2012中都可以选择创建应用程序的安装向导
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.