简体   繁体   English

使用Visual Studio 2012将带有sql数据库的Windows窗体应用程序部署到另一台PC

[英]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.

相关问题 如何使用InstallShield LE为带有SQL Server 2012本地数据库的Visual Studio 2012 Windows窗体应用程序创建setup.exe文件 - How to create a setup.exe file using InstallShield LE for a Visual Studio 2012 Windows Forms Application with SQL Server 2012 Local Database 如何在Visual Studio 2010中使用SQL Server 2012数据库打包和部署C#桌面应用程序? - How to package and deploy a C# desktop application with a SQL Server 2012 database in Visual Studio 2010? 如何在另一个PC上部署具有数据库的C#Windows窗体应用程序? - How to deploy a C# windows form application that has database on another PC? 部署Windows窗体应用程序,该应用程序链接到在另一个系统上Visual Studio 2010上创建的两个excel文件 - deploy a windows form application which links to two excel files created on visual studio 2010 on another system 无法从另一台PC在Visual Studio 2012中打开项目 - Cannot open project in visual studio 2012 from another pc Visual Studio 2012构建Windows 10应用程序? - Visual Studio 2012 build application for windows 10? Visual Studio 2012 Windows Phone应用程序-目标 - Visual Studio 2012 Windows Phone Application - Target 如何添加数据库和Crystal Reports Windows窗体应用程序,以便可以将其部署到客户端PC - How to add database and crystal report yo windows form application so it can be deploy to client pc 我用C#开发了一个应用程序,是否可以在没有SQL Server和Visual Studio的另一台PC上运行该应用程序 - I developed an application in C#, is it possible to run this application on another PC which has no SQL Server and Visual Studio 如何使用Winform Application部署和附加SQL Server Management Studio 2012数据库? - How to deploy and attach SQL Server Management Studio 2012 Database with Winform Application?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM