Check Engine light and gas fill-up

My engine starting running rough right around the time I put gasoline in from a station I never used before. A few days later I noticed the check engine light had come on. Could there have been something in the gas that caused the warning light to come on? I wondered about the possibility of water in the gas to cause a rough engine, but would that cause a check engine light? What else would cause the problems?

That CEL (check engine light) is just a kid in class waving her hand trying to get you attention because she has the answer. You need to have the codes read. Some places will read them for FREE. Try Autozone or Advanced Auto Parts. Get the exact code (like P0123) not just their translation into English and post it back here.  

Yes, there could be a connection, but that code number will help find out.  Yes it could have been something in the gas like water.