Re: Simple thread issue?



when you create a thread, its identity is the process identity, not the starting threads identity, so it will not match the pool account or impersonation account. the the case of asp.net, its the id of the worker process usually a network service account.

you need to pass the desired identity to the new thread and have the new thread impersonate it.

-- bruce (sqlwork.com)

Brian wrote:
I have an file based asp.net application the creates a thread to do some background printing. It works fine but when the application is deployed on a web server, the following error occurs in the thread when it accesses SQL:

Login failed for user ''. The user is not associated with a trusted SQL Server connection.

Note the blank user. It seems that the new thread does not have the credentials but looking at "Thread.CurrentPrincipal", there is a valid user (me).

Is there something I am missing? Does the application need some assembly permissions? I wonder if there are any settings under IIS? Is there any way of telling why SQL cannot access the thread credentials?

Brian


.



Relevant Pages

  • Re: sql problem
    ... Account # is the link field on ... The requirement is I have to come up with a report comparing the two ... customer tables to see if they are in sync. ... what I wanted to do was to get the SQL to return the "like" names ...
    (comp.databases.oracle.server)
  • Re: sql problem
    ... Account # is the link field on ... table1, table2@dblink where ....) ... customer tables to see if they are in sync. ... what I wanted to do was to get the SQL to return the "like" names ...
    (comp.databases.oracle.server)
  • Re: sql problem
    ... Account # is the link field on ... table1, table2@dblink where ....) ... customer tables to see if they are in sync. ... what I wanted to do was to get the SQL to return the "like" ...
    (comp.databases.oracle.server)
  • Re: Problems connecting to SQL Server
    ... Maximo is specifically stating that you must use the SA user ... to be the SQL 7 Product ID while scrounging around in some boxes. ... I will also try MDAC. ... And they specify the SA account. ...
    (microsoft.public.sqlserver.clients)
  • Re: Distributed Query - Linked Servers?
    ... In the case of SQL style accounts, it doesn't seem very secure to me, because the password will be transmitted over the network. ... it should also be able to work by setting up a credential and proxy account on Server1. ... In this case it could work with NTLM authentication. ... we just need to verify that the 2 sql server instances are under sql server and windows authentication mode and the sql account you use has the permission on the 2 sql server instances. ...
    (microsoft.public.sqlserver.server)