由于某些原因,我的.NET(C#)SqlConnection使用了我的Windows会话凭据而不是指定的凭据。有没有办法忽略我的会话凭证并使用我指定的凭证?
SqlConnection myConnection = new SqlConnection("user id=user;" +
"password=pass;server=10.0.10.99;" +
"Trusted_Connection=yes;" +
"database=databasename; " +
"connection timeout=5");
myConnection.Open();
Trusted_Connection
和明确的用户ID/密码,那么信任连接将优先生效。 - marc_s