jonellison84


I'm writing an application for Windows Mobile 5 / Pocket PC using VB.NET 2005. The database is connected using an instance of SqlCeConnection and updated by an SqlCeCommand.

The application can perform select queries on data originally entered into the database through Visual Studio, or perform update / insert queries at run time. Anything inserted or updated can be returned by a select query whilst the application is running, however, anything I have inserted or updated doesn't appear to be written to the SDF file and hence is not in the database after restarting the application.

Am I missing something that's different between performing queries on an SQL CE database on Pocket PC and an ODBC source in a normal Windows application



Re: Performing insert / update queries using Pocket PC / SQL CE

ErikEJ


Keep in mind that the SDF file may be deployed whenever you run the app on your mobile device/emulator. Any inserts or updates done in the copy on the device will therefore not be visible when you stop the app again, since the database file is not copied back to your development machine.







Re: Performing insert / update queries using Pocket PC / SQL CE

jonellison84

The SDF file's held on the storage card as opposed to the program files with the rest of the application. The same happens for any update/insert queries I apply to the database using Query Analyser, they're simply not there when I restart the program...





Re: Performing insert / update queries using Pocket PC / SQL CE

ErikEJ

And you have checked you device /storage card for multiple copies of the sdf file






Re: Performing insert / update queries using Pocket PC / SQL CE

jonellison84

Yes, there's only 1 SDF file (the location of which is hard coded into the project)




Re: Performing insert / update queries using Pocket PC / SQL CE


Re: Performing insert / update queries using Pocket PC / SQL CE

jonellison84

That would still only address the issue if the code was reffering to a database in the directory that visual studio is deploying to. My problem is that the database path is c:\storage card\database.sdf as opposed to c:\program files\application\database.sdf The storage card doesn't get changed by the output of the build so the way in which content is deployed is irrelevant...




Re: Performing insert / update queries using Pocket PC / SQL CE

Sunil Rathore

I have the same problem. As I have the .sdf any changes made in the runtime is not reflected in the physical .sdf file. So, can u specify it more clearly how it works. Please tell me the what settings I have to do, to rectify that problem.




Re: Performing insert / update queries using Pocket PC / SQL CE

jonellison84

I fixed the problem yesterday evening by moving the SDF file from the storage card to the program's directory, it seems that SQL CE that it can't commit changes to the storage card...




Re: Performing insert / update queries using Pocket PC / SQL CE

Sunil Rathore

Hi jonellison84

Could you tell me how it works as I didn't get it.






Re: Performing insert / update queries using Pocket PC / SQL CE

jonellison84

My SDF file was held at C:\Storage Card\Database.SDF, by moving it to C:\Program Files\Application Name\Database.SDF it just started working...




Re: Performing insert / update queries using Pocket PC / SQL CE

Sunil Rathore

Hi jonellison84,

I am not get it as in my local computer there is no C:\Storage Card folder. If you online then can we chat for sometime as I already sended you the freind request on your gmail ID. My email id for that is sun1programmer@gmail.com. Could you please help me to solve out this problem. Thanks






Re: Performing insert / update queries using Pocket PC / SQL CE

Sunil Rathore

Hi jonellison84,

Thanks for chatting, your shared folder concept works good.