I have a .Net console application that uses a QueryString that connects to a SQL Server Database. I’m familiar with the Intergrated Security option… but I’m logged in under another account on the target system (one that has no access to the database).
Is it possible to use other Windows account credentials in the connection string? Or is it possible to programatically ask the user to provide other credentials?
No you cannot ASK for a Windows Login (domain/username/password). It does not work that way. SSPI (integrated security) only works with the current logged in context.
If you had to masquerade as a different user, similar to the “Run As” functionality in Windows, you would have to impersonate the user using different credentials, after which the session (including the program) would be running under the security context of the impersonated user.
e.g. http://www.codeproject.com/KB/dotnet/UserImpersonationInNET.aspx