Posted on: 4/21/2011 7:47:30 AM | Views : 334

Hello,
I have a .NET 4.0 windows forms application which uses a local SQL Express 2005 database.
My users need to be able to back up the database - and choose a location for the .bak file - for example a USB flash drive.
I implemented this by:
1) On user request, create the folder C:/MyDBBackup (Using DirectoryInfo.Create() if the directory does not exist)
2) Execute the sql: "backup database [dbName] to disk = C:/MyDBBackup/myBackup.bak"
3) Move the myBackup.bak file to the location the users wanted to place the backup in.
This has worked well on all machines I have tested it on until yesterday I encountered a windows vista machine of one of my customers where apparently the folder was not created in step #1.  After I manually created the  C:/MyDBBackup folder on that machine - everything worked great.
The application is installed with ClickOnce - full trust
I have tried using the %Te ...

Go to the complete details ...