tags:

views:

39

answers:

1

Here's the relevant part of my code:

    adapter.Fill(table);

    return;
}
catch(Exception ex)
{
    SqlException sqlEx = ex as SqlException;

I have an exception that's being thrown by adapter.Fill(), and when I put a breakpoint on the first line in the exception handler, the Exception.Data property already contains a key that is unique to my application.

The thing is that it does not happen every time, but only when this exception is thrown within ~2 seconds of it last being thrown.

Explain that!!

A: 

From the error you quoted I would assume that the SQL Connection information you are using is not correct, or that the password has expired. Check your connection and test it outside your environment.

If you are using integrated security, it could possible be that the user is not added to the SQL Server security, or the user does not have access to the database. In SQl Server security is a two step process, first add the user to the SQL Server as a valid login and then grant the user access to the database.

Obalix