You said your check engine light was on too right?
Check that for codes.
Now, when it dies, does it slowly sputter and die (fuel) or does it just immediatly die/just stops running (electric)?
Reason I ask is cuz I had similar problems. Start right up and idle right at about 650 or so, then jsut die, no sputter or nothing. It was if I had reached in and turned the key off.
And I was getting an error code, don't remeber which one, but I think it was 14. Something having to do with the the electrical circuit for the ignition.
When it dies, check to see if you are getting spark, via a timing light.
Just an idea.
Good luck.