Don’t Do This in Production
MSDN used to make their code samples as simple as possible for educational reasons, until they realized everyone was just pasting them directly into production applications. So they started adding error handling, etc.