0

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

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

2 Comments

i see, but i am wondering if i can move (or include) the .mdf file to the project installation folder and change the connection string to point to it, how can i do that?
Yes you can do that, it is the XCopy Deployment of SQL Express. I have edited my post to add a link to that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.