Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sql-server/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 在SQL Server连接字符串中使用受信任\u连接时的域注意事项_C#_Sql Server_Connection String_Trustedconnection - Fatal编程技术网

C# 在SQL Server连接字符串中使用受信任\u连接时的域注意事项

C# 在SQL Server连接字符串中使用受信任\u连接时的域注意事项,c#,sql-server,connection-string,trustedconnection,C#,Sql Server,Connection String,Trustedconnection,我一直在试图理解在SQL Server连接字符串(从C#中)中使用trusted_connection=true意味着什么。我知道它使用当前的Windows用户凭据连接到数据库。但这是否意味着数据库服务器和当前用户可以位于不同的域、相同的域或不同但受信任的域中?trusted\u connection=true意味着Integrated Security=SSPI 如果这在连接字符串中不存在,则需要在连接字符串中指定userid和password,如下所示: server=yourservern

我一直在试图理解在SQL Server连接字符串(从C#中)中使用
trusted_connection=true
意味着什么。我知道它使用当前的Windows用户凭据连接到数据库。但这是否意味着数据库服务器和当前用户可以位于不同的域、相同的域或不同但受信任的域中?

trusted\u connection=true
意味着
Integrated Security=SSPI

如果这在连接字符串中不存在,则需要在连接字符串中指定userid和password,如下所示:

server=yourservername;database=yourdatabase;user id=YourUserID;password=password
如果存在两个(
Trusted_Connection=true或Integrated Security=true/SSPI
)中的任何一个,则当前用户的
Windows凭据
将用于针对
SQL Server
进行身份验证,并且将忽略任何useriD=useriD和password=password文本

无论出现多少用户,也无论您登录了多少用户,它都会忽略这些内容,如果:

Trusted_Connection=true 

对不起,这并不能直接回答我的问题。可以提供更多关于我询问的域的详细信息吗?当trusted_connection=true时,域和用户登录数据库的内容将被忽略