Application with database on storage card

I

info

Hi

has someone experience with applications with .NET CF 2.0 (currently no
SP), SQL Mobile 3.0 and a Database on the storage card?

I've some problems, because the StorageCard doesn't get mounted really
quick when the PPC was turned off. So Its somekind of poweraware
problem.

Related to this I got also some problems that then SQL Commands
somteimes doesn't work correctly and I get "Unkown Exceptions"

I added an Thread Sleep and SqlCeConnection.Open()
in the DeviceWake event, which I got via the OpenNETCF classes.
Unfortunately theres a bug in this class , I hope its getting better
when I have the update.

Hope someone may give me hint what to try.

May running time be a source for problems?
 
G

Guest

Running the DB on mountable storage is tough. you have to make sure you
always re-open on wake. Also make sure your app itself is not running right
from the card, that will kill you on wake too, but only after a typically
unreproducable amount of time.

SDF 2.0 will be out shortly - we're just polishing the deployment package.

-Chris
 
B

Boas Enkler

Hi

Running the DB on mountable storage is tough.
Oh yes there a lot of "small" but tricky problems.
If Someone is interessted, I could make a BLog posting with hints and
problems I found and how to solve.

always re-open on wake.
Yes thats what I do, I've also an global connection property which is
used by 90% of my SQLCommands and therefor I got get() and set() method
which check the connection state and reopen the connection if it is
broken oder closed. But sometimes it says "Open" but as soon as I run an
SQLCommand I got an exception that the Command needs an Open and
Prepared connection...

Also make sure your app itself is not running right
from the card.
Yes thats an defined requirement of me, that the user has to install the
application on the local RAM/ROM of the device


SDF 2.0 will be out shortly - we're just polishing the deployment package.
That's great I hope that the problems were solved when the DeviceWake
works :)

Thank you again for your help!
 
L

Lonifasiko

Yes, my experience with the database located in the storage card was
also painful.

I finally took it out of the storage card because I was having
misterious SQL statements executions that made my application
unexpectedly crash.
My problem was also related to using temp files for the SQL Mobile
database. I hoped temp files would improve the performance of all
database related operations of my application but I really did have
many problems with these two issues.

Regards.
 
B

Boas Enkler

Hi
thanks for your feedback
I finally took it out of the storage card because I was having
misterious SQL statements executions that made my application
unexpectedly crash.
Yes I've got same thing here, but when the device waits till the
connection is reopened it seems like it works.
Only sometimes when inserting data in the SqlCe i got strange errors
like data could not be inserted or read, but when the user tries it
again everything works fine.
My problem was also related to using temp files for the SQL Mobile
database. I hoped temp files would improve the performance of all
For Perofrmance issues I use Hashtable which caches some values, for
example: Already selected names of uses, and often used values.

Theres also somekind of timerelated caching so if same Selectes were
execute in a timespane the cached value is used.


BTW isn't there any way to set a timeout for SQL Mobile on PocketPC's so
that it would wait automatically if the DataBaseFile is not there?
 
M

Marcantonio

Boas said:
If Someone is interessted, I could make a BLog posting with hints and
problems I found and how to solve.

That would be great Boas.
I am developing a CF2 app and we're forced to use the .sdf on the SD
Card due to its size.
We are in a very early stage and so far I have never experienced severe
problems, but it would be very nice to have a few hints in advance.

Marcantonio
 
L

Lonifasiko

Hi,

Can you tell us what is the size of your database? Do you expect this
size to grow so much that you have to store it in the storage card?

I'm now dealing with databases under 1Mbyte, but I hope during hard
testing of the application I'll go far in storage size.........

Related to SQL Mobile misterious errors: Could you please take a look
into this post in which I explain a very strange error executing an
update against SQL Mobile database:

http://groups.google.es/group/microsoft.public.sqlserver.ce/browse_thread/thread/3d0ce2db5acdb211

Seems that I'm the only one having this error........

Thanks very much.
 
M

Marcantonio

Hi,
Can you tell us what is the size of your database? Do you expect this
size to grow so much that you have to store it in the storage card?

it's now at 20mb but it's going to be a 200/300mb database.
Related to SQL Mobile misterious errors: Could you please take a look
into this post in which I explain a very strange error executing an
update against SQL Mobile database:

http://groups.google.es/group/microsoft.public.sqlserver.ce/browse_thread/thread/3d0ce2db5acdb211

Lonifasiko, are you 100% sure that the new value you are specifying in
your update statement correctly references an existing patientID in the
"Patient" table? Isn't it a foreign-key problem?

I would need more information - maybe a small project exhibiting this
problem that I can test on my device.

Marcantonio
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top