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

How to get the arclen between two curve points in Maya? -

git svn - Unignore directories in git-svn (adding directories to a sparse checkout) -

C++ Linked List -