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!
**********************************************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top