目的:删除table
详细代码:
string sqlconst = "server=localhost;user=root;database=mytestsql;port=3306;password=root;";
MySqlConnection connect = new MySqlConnection(sqlconst);
connect.Open();
Console.WriteLine("成功链接mysql...");
MySqlCommand command = new MySqlCommand("drop table test002", connect);
try
{
command.ExecuteNonQuery();
}
catch (Exception ex)
{
Console.WriteLine("删除table失败..." + ex.ToString());
}
connect.Close();