Hussain
Hussain

Reputation: 53

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:
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

Upvotes: 0

Views: 2773

Answers (1)

Arif Eqbal
Arif Eqbal

Reputation: 3138

Well I don't think SQL Server works that way. 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.

However, SQL Server Express Edition can be embedded with your application see link: SQL Express Install

Basically the link tells you how you can install SQL Express through your own installer. There is a command switch "/Q" that tells SQL Express to install in silent mode i.e. without showing any UI if you want to do it so.

EDIT: If you want to ship your MDF file along, then look at the MSDN Article on XCopy Deployment

Upvotes: 1

Related Questions