📅  最后修改于: 2022-03-11 15:05:15.437000             🧑  作者: Mango
DataSet ds = new DataSet();
using (MySqlConnection con = new MySqlConnection(connectionstr))
{
using (MySqlCommand cmd = con.CreateCommand())
{
con.Open();
cmd.CommandText = "select * from mysql.user;";
MySqlDataAdapter adapter = new MySqlDataAdapter(cmd);
adapter.Fill(ds);
}
}