schematic for battery and solar cell in parallel
Please explain what you mean by didn't work.
 With no rudeness intended - the connection is simple enough that supplying a diagtram is still no guarantee it will "work" - see below. You appear to have all the parts and appear to have connected them correctly. As it does not work and should, the answer consists of finding out what is wrong.

Please provide a schematic of what YOU have done.
 What you describe sounds like it should work if you have done as you said so your equipment may be wrong or you may be doing something wrong.
ng. 

Charging MUST be done in sunlight  or direct daylight
 Inside light has almost zero energy.
 Where is the PV panel located when you are charging the battery??

PV cell  (= photovoltaic = solar cell) voltage MUST be > 2 x AA battery voltage to charge. Using voltmeter place panel UNLOADED in direct daylight
 Is it?
 For 2 x AA NimH VPV must be > ~= 3.5V unloaded and more ios betterFor 2 x Alkaline AA for Vpv to take over from batteries Vpv unloaded needs to be 4V+ and more is better.



Solar cell addition  sanity check 

Adding the solar cell to the system when it is running from batteries should either
 -  Provide extra energy from the solar cell or
 -  Do nothing
 Stopping it working is not an option ! ;-).
 If it DOES stop it working and the two x AA batteries are still there then the diode is reversed or faulty.

NimH batteries are about 1.2V nominal when working but are say 1.3V when fully charged AND need up to 1.45V per cell in charge mode to fully charge them.
 If a Schottky diode is used it will drop about 0.3V. It a silicon diode is used it will drop about 0.6v.
 So 2 x NimH + Schottky diode need about 1.45 + 1.45 + 0.3 = 3.2V
 That's loaded. Open circuit voltage will be about 1/3 higher = say 4.2V if you want full charging current when battery is almost charged.  My suggested 3.5V minimum was a compromise - with more being better.



To get some idea of PV panel performance


Place in bright daylight on a sunny cloudless day - ideally pointing at the sun at midday.
Measure unloaded voltage = Voc.
Short panel with an ammeter (multimeter on say 200 mA range).
Measure short circuit current = Isc.


Actual achievable power will be ABOUT Vpp x Isc x 0.5