Last year I bent the drain hose into an S shape to create a water trap and that seemed to stop the ants from getting into the dishwasher, but this spring they're back again. Perhaps, as some one suggested, running some water into the dishwasher will help, but if they get through the water trap in the hose why won't they get through water in the bottom of the dishwasher?
Perhaps running some water into the bottom of the dishwasher closes a valve and the closed valve is really what is keeping the ants out?