I've had this problem a few times and I'm just trying to remember how to solve it.
I think that restarting the computer usually helps, if you've got a router maybe you need to reset it.
Try clicking the Internet connection on both computers and make sure it says that they "Share Internet connection: allow other computers to connect through this connection".