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

sql - can we replace full join with union of left and right join? why not? -

javascript - Parallax scrolling and fixed footer code causing width issues -

iOS: Performance of reloading UIImage(name:...) -