It had happened me once. In your Oracle home directory there must be two folder in directory C or D:\app\user\product\11.2.0:
Names of folder must be smth like that:
client_1 and dbhome_1
There must be tnsnames.ora in \client_1\Network\Admin\Sample. If not, create one. Then first of all delete all texts in this file and copy this to that file:
orcl=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=172.16.77.31)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)))
Instead orcl you will write your data Source. Also for host and port number. And Service name.
It must work. If not copy tnsnames.ora and listener.ora to \client_1\Network\Admin.
And test it again.