JamesE

I have a c# app (written for a Windows Mobile 5.0 smartphone) which uses a SQL Compact Edition database for offline storage. My database (OfflineData.sdf) has it's Build Action marked to Content and Copy to Output Directory is set to 'Copy if Newer'. I build this application and whilst browsing my bin\Release folder I can check the attributes of my file OfflineData.sdf and it is NOT marked as read-only.

To my solution I have added a smart device CAB project. I have added Primary Output and Content Files to the 'Application Folder' on the target machines File System. Everything builds fine.

After I install the application on my smartphone and browse the file system of the device, OfflineData.sdf is now marked as read-only. I don't see an option to change this anywhere.

Has anyone got any idea's

Cheers

James




Re: Smart Devices VB and C# Projects Database is read-only after deployment to Smartphone

Zero Dai - MSFT

Dear James,

I'm not quite sure your problem, since I create the smart device cab project with the same steps as yours, and my .sdf file is not set to read-only automatically. Everything is going well.

For the rapid solution to unmark read-only is to use Windows CE Remote File Viewer that shipped with Visual Studio 2005. With this tool, you can modify the attribute of a file on a device/emulator.

Thanks,

Zero Dai - MSFT






Re: Smart Devices VB and C# Projects Database is read-only after deployment to Smartphone

JamesE

This has driven me nuts overnight but this morning I have found the problem - Source Control!!!!

If I build my app with the database checked out, then rebuild the CAB project - the database is deployed without the read-only attribute. If I check it back in again and rebuild, it is deployed with the read-only attribute. It doesn't sound right to me so I'm wondering whether anyone else has had this same problem

Cheers






Re: Smart Devices VB and C# Projects Database is read-only after deployment to Smartphone

InshoreTechnology

i have exactly the same issue. I can get my cab to work if I checkout (or manually make file writeable), but I cannot find a programmatic way to undo the read-only bit before putting the file in the cab. If you have a solution, please share.





Re: Smart Devices VB and C# Projects Database is read-only after deployment to Smartphone

Nathan Kerr

I'm having the same problem too. The only think I can think of is to write a script that will fire off on the install which will change the permissions of the items after they are installed on the mobile device.

It sure makes sense that we should be able to specify the permission for each component when setting up the cab file.