You have an invalid test. You are looping inside the context of a single transaction. When the database goes down any in-progress distributed transaction is aborted. Your loop is trying to bring up a new connection under that already-dead transaction.
I'm not sure exactly what you are trying to test but moving the TransactionScope inside of the while loop should fix it.