How to create backup of ms access using c# code? -


 private void backup()     {         string dbfilename = "clients.accdb";         string currentdatabasepath = path.combine(environment.currentdirectory, dbfilename);         string backtimestamp = path.getfilenamewithoutextension(dbfilename) + path.getextension(dbfilename);         string destfilename = backtimestamp + dbfilename;         folderbrowserdialog fbd = new folderbrowserdialog();         if (fbd.showdialog() == dialogresult.ok)         {             string pathtobackup = fbd.selectedpath.tostring();             destfilename = path.combine(pathtobackup, destfilename);             file.copy(currentdatabasepath, destfilename, true);             messagebox.show("successful backup! ");         }     } 

my database in d drive, have method backup ms access database, not taking backup when add data in database.


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -