mykenshin

Hi,

I developed a small application using VS2005 and SQL mobile. When I debug my application in VS2005, it works perfectly even if I try to deploy on my device. But after I created all the SmartDeviceCab, CustomInstaller and setup projects, and try to install my application on the device, I
cannot find the database file (which is a .sdf file) in the folder where my application is installed. Therefore I always get error message as "the database file cannot be found". Anyone knows what I should to to copy my database file to the device during installation

Any help would be appreciated.

Thanks

mykenshin


Re: Smart Devices VB and C# Projects Cannot deploy database file to mobile device

AlexY

Make sure that your database file is included in your installation project.



Re: Smart Devices VB and C# Projects Cannot deploy database file to mobile device

mykenshin

Thanks for your reply. but what do you mean by included in installation project I can run the application on emulator, so I think the database file is associated with the application project.



Re: Smart Devices VB and C# Projects Cannot deploy database file to mobile device

AlexY

When you run the application using Visual Studio, it deploys all the files that are part of the project automatically. You mentioned that you have the deployment project that creates the installation CAB for your application. So you have to make sure that your database file is a part of your primary output. Switch your deplyment project to the "File System View" and right-click on the "Application Folder" and "Add" the needed file.



Re: Smart Devices VB and C# Projects Cannot deploy database file to mobile device

Zero Dai - MSFT

Dear mykenshin,

The problem is that the .sdf file is not added to your CAB project correctly. Because your database file,generally, does not belong to primary output and it is supposed to be a content files. (You can check if the database file is right there where it should be, following what Alex said)

Here is the solution to add it manually to CAB project:

  1. In the application project, set Build Action property of .sdf to Content.
  2. In the CAB project, add project output for content files.
  3. Or you can right click Program Files Folder, choose File to select the .sdf file that should be added.

Regards,

Zero Dai - MSFT