I think I found my answer. Googling around I stumbled across some code
that conditionally copies the SDF over from the ./pre backup folder.
It seems to test out okay. Here's the code snippet below:
public FrmMain()
{
InitializeComponent();
// Handle an updated SDF database scenario.
if
(System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed)
{
if
(System.Deployment.Application.ApplicationDeployment.CurrentDeployment.IsFirstRun)
{
MigrateData();
}
}
}
private void MigrateData()
{
string preFile =
System.IO.Path.Combine
(System.Deployment.Application.ApplicationDeployment.CurrentDeployment.DataDirectory,
@".\.pre\memoDiamonds.sdf");
if (!System.IO.File.Exists(preFile)) // nothing to migrate
{
return;
}
else
{
string postFile = AppDomain.CurrentDomain.GetData
("DataDirectory") + @"\memoDiamonds.sdf";
System.IO.File.Copy(preFile, postFile, true);
}
}
On Jan 13, 1:46 pm, gregarican <[email protected]> wrote:
> I likely have a basic question that shouldn't be too much of a stretch
> to address. My project I'm deploying consists of a local SDF database
> that's part of my project set. When I publish an update to my app the
> endusers receive an updated copy of my dummy development SDF and lose
> their own local SDF database they've been working with.
>
> Without having to manually define a static data directory location for
> the SDF is there a update deployment option that will allow them to
> keep their own local SDF?