Click here to Skip to main content
15,886,060 members
Please Sign up or sign in to vote.
5.00/5 (2 votes)
I'm new to windows form development. So i have developed a windows form application for my dad.
It uses a small portion of data base i have used sql server 2008 for designing the data base. Now i want to deploy the app so that it may run on my dad's pc without any need of installation of additional softwares(specifically sql server).

I've done my part of googling and found out something about mdf files which could be deployed along with the application. But I don't understand how to deploy that file with the app and how to connect it to the application. Any help or reference links are appreciated..

Or if u think there is a better way to do my task do let me know.

Any help is appreciated.
Thanks in advance. :D #Peace.
Posted
Comments
Sergey Alexandrovich Kryukov 13-Aug-14 12:40pm    
My vote of 5 for you both. For a beginner, this is a perfectly sensible question.
—SA
j snooze 13-Aug-14 12:41pm    
copy the mdf file to your dads pc then use the below as your connection string(modify to your naming standards of course). I'm assuming you currently have some sort of sqlconnection object set up if you are running the app on your machine right now.

Driver={SQL Native Client};Server=.\SQLExpress;AttachDbFilename=c:\[databasefilelocation]\mydbfile.mdf; Database=dbname;Trusted_Connection=Yes;
[no name] 13-Aug-14 12:53pm    
Hey thanks j snooze.. I'll definetly give it a try and let you know if it worked for me or not..
Thanks once again..

1 solution

Your dad needs to install the SQL server, period. Moreover, even though deployment of database service with the application is the acceptable practice, it all heavily depends on licensing models, actually available licenses and maybe business setting. Therefore, the choice #1 is still just claiming the prerequisites for the software product being distributed.

Think by yourself: 1) your customer may already have the required database management system installed; 2) some customers may have licenses, while others may plan to obtain one and have to decide what to use, depending not only your application, but a set of other applications; 3) some customer may have a commercial version of the database management system, but other can install a version based on free-of-charge license, while both options could be suitable for using your product, 4) and so on… If you enforce installing some particular version of a 3rd-party product which comes with your product, it could compromise this flexibility. That's why prerequisite-based approach is better for many cases.

You can read about deployment of each particular database server in manufacturer's documentation. On SQL server, please see:
http://msdn.microsoft.com/en-us/library/hh699753.aspx[^],
http://technet.microsoft.com/en-us/library/bb522540%28v=sql.105%29.aspx[^],
http://technet.microsoft.com/en-us/library/ms165716%28v=sql.105%29.aspx[^],
http://technet.microsoft.com/en-us/library/gg213826%28v=sql.110%29.aspx[^], and so on.

Best regards to your dad and my respect. Collaboration between family members can be very productive and can even create the condition for creation of best quality work. This is because the best work is done by those who care and understand.

—SA
 
Share this answer
 
v2
Comments
[no name] 13-Aug-14 12:49pm    
Hey thanks for such a quick reply..
So you are suggesting that my dad should also have sqlserver installed on his pc.. Well that can be done..
But how do i make my application connect to that sqlserver in my dad's pc..
I've been only few weeks into .Net (2 weeks to be more precise) so i dont really understand how to deploy an app and use the db of client side system ..

And can you direct me to any link which would explain me about the prerequistic model.. I don't clearly understand it yet..

Well once again thanks for helping me out here..
Sergey Alexandrovich Kryukov 13-Aug-14 13:18pm    
"Prerequisite model" is as simple as that: you write some release notes and primary documentation, like "read me". And you claim:
prerequisites: SQL server v.2008 or later or SQL Server Express v.***; .NET v.3.5, and the like. The user reads this and act accordingly, starting from the decision to use your product or not.

That's all.

—SA
[no name] 13-Aug-14 13:23pm    
Ohh!! So we just tell the user what all additional features or applications he needs to has on his pc to make our application work..
Thanks for helping :)
Sergey Alexandrovich Kryukov 13-Aug-14 13:24pm    
You are very welcome.
Good luck, call again.
—SA
PIEBALDconsult 13-Aug-14 13:28pm    
Yes.

"needs to has on his pc" -- Not necessarily "on", but "available to".

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900