ClickOnce issue

k3n51mm

Active member
Joined
Mar 7, 2007
Messages
40
Programming Experience
3-5
We have a VB.Net 2005 application deployed via ClickOnce.
A part of the program is a SQLCE database.
Despite selecting 'Content', 'Copy if newer' at compile time, it is apparently overwriting the existing database no matter what.
However if we change the setting on the database file to 'Content', 'Do not copy', then first-time users will not get the database.

What do we do? I had considered making the database an embedded resource so we have complete control over it, but I don't know what I could use as a connection string; also, I doubt SQL CE will work that way.

Any and all input is appreciated.
 
Are you certain youre changing no aspect of the development database? What file date is on the published db? Is it really newer than the local copy? Doesn the publishing process touch it in some way? Can you touch it back?
 
thanks for the response, I have it sorted.

You don't have to change the database in any way. Just look at it in the designer, drag a table adapter across the screen, and it will update the database file via the graphical designer in the background... then BOOM, next time you publish, it will overwrite the database whether you want it to or not.

So, the answer is to be sure to have data migration code in place before deploying a database via a clickonce installation (mine is 'only' 2000 lines of code, written in 18 straight hours due to deadline). Otherwise, you're begging for the same trouble I had.

Whatever, I don't want to think about ti any more. It was hell.
 
Back
Top