Impersonate user with trusted connection to SQL Server

From: Burkhard Vogt (
Date: 09/18/02

From: "Burkhard Vogt" <>
Date: Wed, 18 Sep 2002 08:49:07 -0700


I'm trying to change the user accunt on a WinForms

I use Win32-Api LogonUser to create a new WindosIdentity-
Object 'newuser'.
Then I call newuser.Impersonate() to change the users
identity in the AppDomain.
This all works fine and WindowsIdentity.GetCurrent()
returns the new user.
The problem is, if I try to establish a connection to SQL
Server with 'truested_connection=yes' in the connect
string the application trys to logon with NT-

Any idea?