Question How to deploy windows application with attached .sdf db files?

jak

Member
Joined
Feb 21, 2009
Messages
19
Programming Experience
Beginner
Hello Experts,
I am working on vs2008+vb+sqlserver compact edition project which hav a attached .sdf database. Now i want to deploy my project to clients machine. I dont want to embbed sqlserver ce with my setup and also on clients machine. Now i m not getting idea, how to add sqlserver ce dll files with my application to deploy on client side and also i don't hav any experience of deployment. I m using a third party code security tool to prevent my codes and which also provides licencing facilities. So, How could i manage all these stuffs for successfull application deployment? I m newbie so please guide me in details and step by step if possible....thanx 4 ur time...!!!
 
There are several places in project you can see deployment settings has automatically been catered for. Look in properties for the project database file, Build Action is set to content and Copy mode to Newer/Always. Go into Publish tab of project properties and click the Application Files button, here you can see same database file is included in deployment as a required Data File, this means it will be deployed to the applications data directory.

Now have a look in Settings tab of project properties, here you should find a connection string setting where value is something like "Data Source=|DataDirectory|\testCe.sdf", notice the "|DataDirectory|" part, this is a keyword that translates to the data directory path for the application. The generated strongly typed dataset with related classes use this connectionstring to find the database both when debugging and after deployment.

Back to Publish tab check out the Prerequisites button, here you can see several options are checked including .Net Framework and SQL CE 3.5, and that they should be downloaded from vendor (Microsoft). Checking the Create Setup program option will create a setup.exe that will detect client system for prerequisites, and if needed automatically download and install them before installing your app.

The same settings and options should basically apply for msi Setup projects (only available in VS Pro).
 
Thanx John, so is it must to install sqlserver ce on clients machine? If not then how i could i do this..:confused:
 
Yes, the SQL engine/provider must be installed, the prerequisite setup makes sure this is done.
 
Back
Top