public static int FL_mysql_execute_command(string Constring, string SqlCommand) { var r = 0; try { var Connection = new MySqlConnection(Constring); var Cmd = new MySqlCommand(SqlCommand, Connection); r = Cmd.ExecuteCommand(); } catch (MySqlException e) { MessageBox.Show("Error : " + e.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error); } return(r); }