[英]deploy a windows form application with sql database to another PC using visual studio 2012
Hello, i am new to .NET developing and i wanted to know How can I deploy a windows form application with sql server 2012 database, i have created database in sql server management studio 2012 and used it in my application by code using this connection string: 您好,我是.NET开发的新手,我想知道如何使用sql server 2012数据库部署Windows窗体应用程序,我已经在sql server management studio 2012中创建了数据库,并使用此连接字符串通过代码在我的应用程序中使用了该数据库:
SqlConnection connection = new SqlConnection("Data Source=.;Initial Catalog=Revision;Integrated Security=True");
i know how to deploy and setup the project but my problem is i want to include the database within it so that the application on the client machine can access it. 我知道如何部署和设置项目,但是我的问题是我想在其中包含数据库,以便客户端计算机上的应用程序可以访问它。
thanks in advance 提前致谢
Well I don't think SQL Server works that way. 好吧,我不认为SQL Server可以那样工作。 You will need to ensure that SQL Server is installed on the machine or any of the machines on the network and the connection string properly points to it.
您将需要确保在计算机或网络上的任何计算机上安装了SQL Server,并且连接字符串正确指向该服务器。
However, SQL Server Express Edition can be embedded with your application see link: SQL Express Install 但是,SQL Server Express Edition可以与您的应用程序一起嵌入,请参见链接: SQL Express安装
Basically the link tells you how you can install SQL Express through your own installer. 基本上,链接告诉您如何通过自己的安装程序安装SQL Express。 There is a command switch "/Q" that tells SQL Express to install in silent mode ie without showing any UI if you want to do it so.
有一个命令开关“ / Q”,它告诉SQL Express以静默方式安装,即如果您愿意的话不显示任何UI。
EDIT: If you want to ship your MDF file along, then look at the MSDN Article on XCopy Deployment 编辑:如果您要一起发送您的MDF文件,然后查看有关XCopy部署的MSDN文章
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.