I think that the connection code is fine now. The error you are receiving appears to be due to the stored procedure you are calling.
I found an article here that seems to address this error and it has to do with not calling sys.sp_UnsetAppRole when you are done which seems to spawn the error because of connection pooling.