Dump Example error
Posted: Fri 14 Oct 2005 11:28
VS:2003 and CoreLab.MySql:2.80.9.0
When using C# dump example come with CoreLab installer, I tried to backup an MySQL 4.0 DB in Traditional Chinese and save the file. The file give text like:
The DB table charset is utf8 and InnoDB.
What code should I modify to have correct text?
Backup function:
Save function:
Thanks
When using C# dump example come with CoreLab installer, I tried to backup an MySQL 4.0 DB in Traditional Chinese and save the file. The file give text like:
The DB table charset is utf8 and InnoDB.
What code should I modify to have correct text?
Backup function:
Code: Select all
private void btBackup_Click(object sender, System.EventArgs e) {
StringBuilder Tables = new StringBuilder();
foreach (String str in lbSelected.Items)
Tables.AppendFormat("`{0}`;",str);
mySqlDump.Tables = Tables.ToString();
statusBar.Panels[0].Text = "Backup in progress";
mySqlDump.Backup();
statusBar.Panels[0].Text = "Backup complete";
}
Code: Select all
private void btSave_Click(object sender, System.EventArgs e) {
if (saveFileDialog.ShowDialog() == DialogResult.OK) {
Stream stream = saveFileDialog.OpenFile();
if (stream != null) {
statusBar.Panels[0].Text = "Save in progress";
Encoding unicodeString = Encoding.Unicode;
stream.Write( unicodeString.GetBytes(mySqlDump.DumpText), 0, unicodeString.GetBytes(mySqlDump.DumpText).Length);
stream.Close();
statusBar.Panels[0].Text = "Save complete";
}
}
}