// public void Edit(string newDescription) // { // MySqlConnection conn = DB.Connection(); // conn.Open(); // var cmd = conn.CreateCommand() as MySqlCommand; // cmd.CommandText = @"UPDATE categories SET name = @newDescription WHERE id = @searchId;"; // MySqlParameter searchId = new MySqlParameter(); // searchId.ParameterName = "@searchId"; // searchId.Value = _id; // cmd.Parameters.Add(searchId); // MySqlParameter description = new MySqlParameter(); // description.ParameterName = "@newDescription"; // description.Value = newDescription; // cmd.Parameters.Add(description); // cmd.ExecuteNonQuery(); // _name = newDescription; // <--- This line is new! // conn.Close(); // if (conn != null) // { // conn.Dispose(); // } // } public void Dispose() { Speciality.ClearAll(); Doctor.DeleteAll(); }