Search code examples
c#mysqldatabaseremote-server

Remove MySql database table on remote server from C# application


If I can create MySql database table on remote server from C# desktop application string createTableQuery = string.Format(table, tableName); and var cmd = new MySql.Data.MySqlClient.MySqlCommand(createTableQuery, conn); Then how do I remove table from MySql database by tableName

Any guide, advice or example would helpful


Solution

  • Just write an inline query with DROP TABLE TABLENAME command and pass it as an argument to your MYSQLCOMMAND. If the user has necessary permission, It will drop the table. Check here