views:

42

answers:

1

We are using RDLC's in a Asp.net web application. For reasons beyond our understanding, the first call to the database server fails with the following error:

An error has occurred during report processing. Cannot open database "TryParkingIt2" requested by the login. The login failed. Login failed for user 'EXTRANET\OurServerNameHere$'.

Run the report again, it works.

Huh?

Update Click the button the first time, it fails. Click the button again, it works. The account being impersonated is a domain account. Also, this error occurs on all five different report pages, which is why I didn't include any code.

+1  A: 

Look for static constructors or global.asax code that is failing. Those are run only once when the application starts up (actually for static constructors are run when the class is first accessed), so often they will cause a failure the first time, and then everything seems to work fine after that (even though something is really busted up in the background).

BTW, this is a GREAT reason to avoid static constructors.

Mike Mooney