backup and restore one table only

Jul 28, 2015 at 11:15 AM
how to backup and restore only one table
Coordinator
Jul 29, 2015 at 12:59 AM
This is the sample code that export only one table:
void Export()
{
    var dic = new Dictionary<string,string>();
    dic["tableA"] = "SELECT * FROM `tableA`;";
    using (MySqlConnection conn = new MySqlConnection(connectionString))
    {
        using (MySqlCommand cmd = new MySqlCommand())
        {
            using (MySqlBackup mb = new MySqlBackup(cmd))
            {
                cmd.Connection = conn;
                conn.Open();
                mb.ExportInfo.TablesToBeExportedDic = dic;
                mb.ExportToFile("C:\\backup.sql");
            }
        }
    }
}
Aug 13, 2015 at 3:44 AM
thank you for your response