Author: coolvaas1 | Posted on: 10/29/2008 11:04:46 AM | Views : 557

I have writtena web application with forms authentication with AD. Everything works well. Now I want to imporsonate the logged in user to run quesries against the SQL server database. SQL server is set to "mix mode".
When I use the imporsonation code it, give me the following message (which is obvious). I am not sure how to correct this.
Unable to cast object of type 'System.Web.Security.FormsIdentity' to type 'System.Security.Principal.WindowsIdentity'
My code :
Dim impersonationContext As System.Security.Principal.WindowsImpersonationContext Dim currentWindowsIdentity As System.Security.Principal.WindowsIdentity
currentWindowsIdentity = Go to the complete details ...