Hello to All
After few attempts to find how to use the .net assembly with Windev, i have been able to find the solution and i would like to show you this simple code:
First you need to download the .dll (MySql.Data.dll and MySqlBackup.dll) from this site: [mysqlbackupnet.codeplex.com]
Then create two buttons on your form (Backup and Restore) with this code:
Hope in this help
Thanks for your attention
Gianni
After few attempts to find how to use the .net assembly with Windev, i have been able to find the solution and i would like to show you this simple code:
First you need to download the .dll (MySql.Data.dll and MySqlBackup.dll) from this site: [mysqlbackupnet.codeplex.com]
Then create two buttons on your form (Backup and Restore) with this code:
conString is string="server=localhost;user=root;pwd=querty;database=test;" conString+= "charset=utf8;convertzerodatetime=true;" conn is object MySql.Data.MySqlClient.MySqlConnection (conString) filename is string="Backup.Sql" cmd is object MySql.Data.MySqlClient.MySqlCommand(conString,conn) mb is object MySqlBackup (cmd) conn.Open() mb.ExportToFile(filename) // to backup the database //mb.ImportFromFile(filename) //to restore from dump file conn.Close()
Hope in this help
Thanks for your attention
Gianni