Question : Problem: How to reduce sql database size in compact framework environment?

Our application runs on portable CE 5.0 devices.  Our app has ten data tables all in one file named data.sdf.  Normally these tables have relatively few records in them, where the entire data.sdf is less than 500KB in size, which is good (since we're in a portable environment).  But now and then we have users who will load tens of thousands of records into one of the tables, causing data.sdf to grow to 2 or 3 MB in size (not good).  This is typically only a one-time occurence, and we need a way to shrink the physical file size of data.sdf back down after deleting the records from that one large table.  

How can we do this?  Will I have to write code to export each record from each table, and then re-import all of them into a new .sdf file?  Or, is there (hopefully) an easier way to do this?  TIA

Answer : Problem: How to reduce sql database size in compact framework environment?

I am in the process of doing exactly the same thing;
I found this article that looks helpful, we will be testing the AutoShrink in the connection string, but also coding the other methods mentioned into the "utility" section of our app.

http://msdn2.microsoft.com/en-us/library/ms172411.aspx

Hope it helps.
Random Solutions  
 
programming4us programming4us