Show us the code where the null pointer exception is occurring and someone may be able to help you. As it is now we can't.
I will take a stab in the dark, though, and lay a small wager on the possibilty that somewhere in your code you are catching and ignoring SQLExceptions which then, later, causes you to attempt to use a reference that hasn't been defined yet.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com