I need to restore the MySQL database that I used which is a service based database, when I click the button 'RESTORE DATABASE'. I'm using VB.Net 2010. I already did a research for any solution, but I can't come up with any idea how to make it work. Do you have any ideas in mind that might help? I'm currently doing how to backup the database, so any help would be really much appreciated.
Here is the sample code:
Private Sub cmdrestore_Click (ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdrestore.Click
Dim s As System.IO.StreamWriter
Try
Dim portfolioPath As String = My.Application.Info.DirectoryPath
FileCopy(portfolioPath & "\Backup\Database1.mdf", "C:\Payroll System\Database1.Mdf")
MsgBox("Restore completed successfully", vbInformation, "DBBES-B Payroll System")
Catch ex As Exception
Dim MessageString As String = "Report this error to the system administrator: " & ControlChars.NewLine & ex.Message
Dim TitleString As String = "Employee Master Details Data Load Failed"
MessageBox.Show(MessageString, TitleString, MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub