What OS(s) are you using?
Windows comes with some functionality to connect two computers in the way that you want (different versions have different levels of functionality). Try searching Windows Help for 'direct cable connection' and have a look
here.