How can I set a thread identity?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

When I start a new thread the db connection fails with "Login failed for user '(null)'.."

I tried to set WindowsIndentity, but it still does not work

Code inside the new thread

===
WindowsPrincipal wp = new WindowsPrincipal(wi)
Thread.CurrentPrincipal = wp;

======

When I start a new thread, I pass it the current identity

===
DbReader dr = new DbReader (GetCurrent())
Thread DbThread = new Thread(new ThreadStart(dr.GetDataFromDb))
====

But is still gives me "Login failed for user '(null)'.."

What am I doing wrong

Thanks

-Sta
 
Do not have the time for a lengthy diatribe, but look at
WindowsIdentity.Impersonate Method in the help file

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

**********************************************************************
Think Outside the Box!
**********************************************************************
 
Back
Top