If you receive "Cannot generate SSPI context" when trying to connect to SQL Server using Integrated Security grab yourself a coffee, find a comfy seat and prepare yourself for several hours of hardcore debugging.
First read thru this article: http://support.microsoft.com/?id=811889
If you not familar with Kerberos or NTLM you might just want to give up now!
The solution I'm about to supply is for one of many problems that may cause this error message. It might sound simple when I list it out but believe me this is the result of many hours wasted in front of my laptop.
Firstly my sql connections were working fine. Then after a reboot - nothing but "Cannot generate SSPI context" errors.
Nothing had changed. Honest.
After a lot of debugging I realised that when it worked i was connected (via VPN) to my office's domain. Therefore I could see and communicate with the DC. Something that is required for Kerberos.
After the reboot I did not reconnect to the VPN, therefore Kerberos was not used. I believe that cached credentials are no good.
Therefore NTLM was being used this time around. By why wasnt this working?
Again many hours passed before I realised that the NT LM Security Support Provider service was not running on my box.
Starting this and performing a reboot to pick up new token got my application working again.
Sigh. Now for some real work.
[Update: 1 hour later!] I'm still having "issues". I'll post more if I figure this bugger out!