Visual Studio Recommending to Simplify Using Command
问题 I've noticed since updating Visual Studio that it is now recommending to simplify my MySQL using statements. It wants to change this: using (MySqlCommand command = new MySqlCommand(sql_string, connection)) { command.Parameters.AddWithValue("@id", id); MySqlDataReader reader = command.ExecuteReader(); if (reader.HasRows) { reader.Read(); business = new Business() { Id = int.Parse(reader["id"].ToString()), Name = reader["name"].ToString(), }; reader.Dispose(); } } Into this: using MySqlCommand