For some reason my .NET (C#) SqlConnection uses my Windows session credentials instead of the specified ones. Is there a way to ignore my session credentials and use the ones I specified?
SqlConnection myConnection = new SqlConnection("user id=user;" +
"password=pass;server=10.0.10.99;" +
"Trusted_Connection=yes;" +
"database=databasename; " +
"connection timeout=5");
myConnection.Open();
Remove
Trusted_Connection=yes;which indicates that integrated security is used and which leads to your Windows credentials getting used.For a quick reference on connection strings attributes you can take a look at:
The Connection String Reference