My pi is connected to two different networks, one by ethernet and one by a wifi dongle. The ethernet network is not connected to the internet but the wireless one is. The pi automatically uses ethernet to try to access the internet and obviously fails. How can I force it to use wifi?
Your default route most likely points the traffic to that wired interface's default gateway. You may see the routes by issuing for example
Hopefully this helps.