c# 4.0 - not ab;e to restore database from .bak file -


i habe taken backup of sql server ce database not able resotore it.

   try       {           string filename = "tapedatabase.sdf";           string sourcepath = backuppath;           openfiledialog ofd = new openfiledialog();           ofd.showdialog();           string fn = ofd.filename;            string restorepath =   path.getdirectoryname(system.windows.forms.application.startuppath);            string sourcefile = system.io.path.combine(fn);           string destfile = system.io.path.combine(restorepath, filename);           try           {            system.io.file.copy(sourcefile, destfile, true);            messagebox.show("database restored to: " + destfile, "info");           }           catch(exception epp)             {               messagebox.show("database not restored");             } 


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -