MySqlBackupNET/MySqlBackup.Net

Views aren't be exported

aarhor opened this issue · 2 comments

I want to use this Library in my Project (.NET 7). It works fine, but there aren't any views in the sql file.
For the Backup I use the following code:

public static bool Create_DB_Backup(string Destination)
    {
       try
        {
            using (MySqlConnection conn = new MySqlConnection(Connectionstring()))
            {
               using (MySqlCommand cmd = new MySqlCommand())
                {
                    using (MySqlBackup mb = new MySqlBackup(cmd))
                    {
                        cmd.Connection = conn;
                        conn.Open();
                        mb.ExportInfo.ExportViews = true;
                        mb.ExportToFile(Destination);
                        conn.Close();
                    }
                }
            }
            return true;
        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.Message.ToString());
            return false;
        }
    }

Your code appears to be correct. I'm not able to recreate the error that you've mentioned. Perhaps, you error is related to something else.

Hello,
Thanks for the answer. I'll have a look into it. Maybe something has changed in my project since my original post...