Restoring Database.........

  • 13 years ago

    Hi, Guys

    I want to restore my mysql database through my vb.net programatically

    I have backed up my db in vb.net and also tried using mysql.exe to restore database

    But Not working Pls help me

    Thanks in Advance

    Swapnil    

  • 13 years ago

    Hi,

    I post something like this before here and in mysql web site and I didnt get help. Try this:

    Private

    Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click

    Dim OpenFileDialog1 As New OpenFileDialog

    OpenFileDialog1.Title =

    "Database Recovery"

    OpenFileDialog1.Filter =

    "Backup Files(*.dmp)|*.dmp"

    OpenFileDialog1.FilterIndex = 1

    If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then

    Try

    Shell(

    """C:\Program Files\MySQL\MySQL Server 5.0\bin\mysql.exe"" --user=" & wContainer.Username & " --password=" & wContainer.Password & " --host=localhost < """ & OpenFileDialog1.FileName & """")

    MsgBox(

    "Database restored successfully", MsgBoxStyle.Information, "System information")

    Catch ex As Exception

    MsgBox(ex.Message, MsgBoxStyle.Critical,

    "Error")

    End Try

    End If

    End Sub

    Good luck.

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“There are only two kinds of languages: the ones people complain about and the ones nobody uses” - Bjarne Stroustrup