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
Post a Comment