From my c# code behind, i pass a query to mysql database and get the data in a DataTable.
Now i want to use the data in data table to write the Insert query in a script file [.sql]
The objective of doing so is, whatever records i select from mysql, i should write that to a script file as backup. Thais why i need the insert statements.
How ? Or any other idea is appreciated.
Isn’t that why they invented mysqldump?
This allows you to dump a table to as file, as a create statement + a bunch of insert statements.
EDIT: see also this article about Using mysqldump