It is a bit small, but the first couple lines appears to be:
What is this code supposed to be doing? My first guess was that you were trying to switch the connection's current database to "IntranetApps", which would look like this:
But the rest of the code doesn't require that. Remove it?