Ants don't eat sweet corn or harm sweet corn plants. If the ants are attracted to your sweet corn plants it is because of aphids. You might want to treat the aphids by crushing them with your fingers or blasting them with a strong stream of water from the hose. Aphids are tiny insects that secrete honeydew and are called piercing-sucking insects because that is what they do to the plant. If you find sticky sap leaking from the sweet corn, look for aphids.
For a photo and additional information on corn leaf aphids view:
Corn Leaf Aphids