Hopefully you have a "crossover cable" to connect the 2 PCs.
1. Check in device manager on each machine to see if there is any problems with the network adapters (yellow exclamation mark).
If not then
2. Disconnect fom the web and disable the firewall on both machines to see if this solves the problem. reenable the firewalls one at a time to see which may be the problem