Tanya,
Adult fungus gnats fly around and are an annoyance, but they are not harmful to people. Each gnat lives for about 5 days. The trick is to get rid of the next generation - the gnat larvae that live in the top layer of the soil. The larvae feed on decaying organic matter. Decaying pine bark in potting mixes and decaying
plants roots feed the larvae. Try to keep the soil as dry as possible. Remove all loose soil from the surface and put a light layer of coir (coconut husk) or sand or diatomaceous earth on the soil surface. These substances have sharp edges that carve up the larvae.
Another safe technique is to place ½ inch slices of raw
potato on the surface of the soil. After a day or so, discard the slices along with the larvae inside. Repeat this until there are no more larvae in the
potato.
Detection trick: Add a little water to the soil and then look very closely for tiny fungus gnat larvae swimming in the water as it pools on the surface. You need good light and good eyes to see them. If you don't, then your
plant is probably gnat free.
Prevention is often the best remedy. Use sterile potting mixes that are free of bark chips. The potting mix should have ample drainage material, such as perlite so that it drains well and allows the soil to dry out frequently. Fungus gnats can nearly always be traced back to overwatering and/or poor soil quality.
BTW, diazinon is hightly toxic and I don't recommend it for home use, especially if there are pets or toddlers around. If you insist on using a pesticide, use Merit because it is less hazardous and more effective.
Replacing all of the soil is a drastic measure that may eliminate the gnat larvae, but may also kill the
plant.
Corn
plants do best in bright indirect light, in front of a north window, for example. They have small root systems and rearely need repotting. Allow the top quarter of the rootball to dry out before watering thoroughly. If your local tap water is on the hard side, switch to filtered, distilled, or rainwater.