Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET
Hi Everyone
 
I hope you help me because i'm stuck with a big problem of setup and deployment I have developped an application with vb 2010 and the database is designed with sql server express 2008 R2 and i try to find a best solution to my problem. My problem : I want to deploy my application on another machine so once it's installed the end user is to be able to connect a database and use it for updating data , delete, adding data ...etc so the connection string was my big problem because the target machine doesn't have sql server express 2008 installed and net framework 4 too .
 
If we assume that the target machine has sql server express 2008 installed ,how i can know the name of server , the name of instance running on that machibe...etc ?
 
Where to copy my database files (.mdf and .ldf) in my project application ? is it in output project : \BIN\DEBUG or where ? because i think my connection string depends on the path where these database files (.mdf and .ldf).
 
My connection string is in code of my application exactly in module ,i have declared it Public it look like this :
 
Public strcon as string="data source=.\SQLExpress,AttachDbFilename=|Datadirectory|MyDatabase.mdf;Integrated Security=True;User Instance=True" 
 
One more thing, I use setup and deployment of visual studio 2010
 
Please advise me on the best solution because it's been several weeks since I try but I'm lost and confused about the best solution.
 
Thanks in advance
Posted 12-Nov-12 7:28am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hi. There are many ways to accomplish your task.
You could create custom dialog form wich will process data user enters and custom actions. You should set MS SQL Express dependancy and allow user to choose other than Express instances (if ones were installed already on target system) - Developer, Enterprise etc.
Also you could implement file dialog for database path exctraction.
Though I suggest you not to copy *.mdf files if possible. Try to create database script and implement its execution in custom action.
 
Please refer these links below for details... or google for something else Smile | :)
1. http://msdn.microsoft.com/en-us/library/d9k65z2d(v=vs.100).aspx[^]
2. How to create custom dialog boxes using the Web Setup Project in Visual Studio 2010[^]
3. Custom Action in Visual Studio setup projects[^]
 
Good luck!
  Permalink  

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

  Print Answers RSS
0 CPallini 540
1 Sergey Alexandrovich Kryukov 420
2 George Jonsson 328
3 Pheonyx 218
4 OriginalGriff 215
0 OriginalGriff 4,813
1 CPallini 3,890
2 Sergey Alexandrovich Kryukov 3,274
3 George Jonsson 2,552
4 Gihan Liyanage 2,186


Advertise | Privacy | Mobile
Web02 | 2.8.140905.1 | Last Updated 13 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100