c# - SQL Server Windows Auth using other Credentials than logged on User -


i got connection string in c#:

    strg_sql_connection = @"server=server\instance; database=db;uid=domain\user; password=password;"; 

it tries login using user logged on on development machine don't want. how can fix this?

you cannot use windows credentials connection string. process, or @ least thread, must impersonate desired user before establishing connection. there many ways can impersonate, refer msdn details. see windowsidentity.impersonate() and/or client impersonation.

a trivial way achieve impersonation using runas.exe


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

Laravel mail error `Swift_TransportException in StreamBuffer.php line 269: Connection could not be established with host smtp.gmail.com [ #0]` -

c# SetCompatibleTextRenderingDefault must be called before the first -