problem with backup of data base
-
hello every one i am using VS 2005 now i am having mdi form in that i am having 1 toolstrip menu item of backup which has the functionality of backup of my whole database for that i wrote code like
imports system.io
Directory.CreateDirectory("c:\ backup")Dim a As String = " c:\\myproject\\bin\\debug\\my.mdf" Dim d As String = "c:\\backup\\my.mdf" FileCopy(a, d) MsgBox("backup Successfully")
but the problem is the directory name backup is created but data base is not copied in it please help :) :)
-
hello every one i am using VS 2005 now i am having mdi form in that i am having 1 toolstrip menu item of backup which has the functionality of backup of my whole database for that i wrote code like
imports system.io
Directory.CreateDirectory("c:\ backup")Dim a As String = " c:\\myproject\\bin\\debug\\my.mdf" Dim d As String = "c:\\backup\\my.mdf" FileCopy(a, d) MsgBox("backup Successfully")
but the problem is the directory name backup is created but data base is not copied in it please help :) :)
I think the problem is Directory.CreateDirectory("c:\ backup") Remove the space after "\" :-\
Rajesh B --> A Poor Workman Blames His Tools <--
-
I think the problem is Directory.CreateDirectory("c:\ backup") Remove the space after "\" :-\
Rajesh B --> A Poor Workman Blames His Tools <--
hello i tried by removing space but still it doesnot copy my.mdf file to backup directory please suggest... thank you... :) :)
-
hello i tried by removing space but still it doesnot copy my.mdf file to backup directory please suggest... thank you... :) :)
-
hello every one i am using VS 2005 now i am having mdi form in that i am having 1 toolstrip menu item of backup which has the functionality of backup of my whole database for that i wrote code like
imports system.io
Directory.CreateDirectory("c:\ backup")Dim a As String = " c:\\myproject\\bin\\debug\\my.mdf" Dim d As String = "c:\\backup\\my.mdf" FileCopy(a, d) MsgBox("backup Successfully")
but the problem is the directory name backup is created but data base is not copied in it please help :) :)
If Not IO.directory.exists("C:\Backup") Then
IO.Directory.Create("C:\Backup")
End IfDim a As String = "C:\Myproject\bin\debug\my.mdf"
Dim d As String = "C:\Backup\my.mdf"
IO.File.Copy(a,d)
MsgBox("Backup of 'my.mdf' was succesfull.")This should do the trick. :)
Motivation is the key to software development.
-
If Not IO.directory.exists("C:\Backup") Then
IO.Directory.Create("C:\Backup")
End IfDim a As String = "C:\Myproject\bin\debug\my.mdf"
Dim d As String = "C:\Backup\my.mdf"
IO.File.Copy(a,d)
MsgBox("Backup of 'my.mdf' was succesfull.")This should do the trick. :)
Motivation is the key to software development.
hello i tried with code you suggested but this is not working... there is still no copy of my.mdf file is made to Backup folder.. just folder with blank data is created in c drive... please suggest...
-
hello i tried with code you suggested but this is not working... there is still no copy of my.mdf file is made to Backup folder.. just folder with blank data is created in c drive... please suggest...
-
hello i tried with code you suggested but this is not working... there is still no copy of my.mdf file is made to Backup folder.. just folder with blank data is created in c drive... please suggest...
-
hello every one i am using VS 2005 now i am having mdi form in that i am having 1 toolstrip menu item of backup which has the functionality of backup of my whole database for that i wrote code like
imports system.io
Directory.CreateDirectory("c:\ backup")Dim a As String = " c:\\myproject\\bin\\debug\\my.mdf" Dim d As String = "c:\\backup\\my.mdf" FileCopy(a, d) MsgBox("backup Successfully")
but the problem is the directory name backup is created but data base is not copied in it please help :) :)