问题描述
我很好奇SQL Server连接字符串中的令牌 Trusted_Connection和集成安全性之间的区别(我相信其他数据库/驱动程序不支持这些区别)。我了解它们是等效的。
I'm curious what the difference between the token "Trusted_Connection" and "Integrated Security" in SQL Server connection strings (I believe other databases/drivers don't support these). I understand that they are equivilent.
推荐答案
它们彼此是同义词,可以互换使用。
They are synonyms for each other and can be used interchangeably.
.Net中有一个名为,对于使用类型安全属性来构建字符串的某些部分的 SQL Server 连接字符串非常有用。此类保留一个内部同义词列表,以便可以从一个值映射到另一个值:
In .Net, there is a class called SqlConnectionStringBuilder that is very useful for dealing with SQL Server connection strings using type-safe properties to build up parts of the string. This class keeps an internal list of synonyms so it can map from one value to another:
+----------------------+-------------------------+
| Value | Synonym |
+----------------------+-------------------------+
| app | application name |
| async | asynchronous processing |
| extended properties | attachdbfilename |
| initial file name | attachdbfilename |
| connection timeout | connect timeout |
| timeout | connect timeout |
| language | current language |
| addr | data source |
| address | data source |
| network address | data source |
| server | data source |
| database | initial catalog |
| trusted_connection | integrated security |
| connection lifetime | load balance timeout |
| net | network library |
| network | network library |
| pwd | password |
| persistsecurityinfo | persist security info |
| uid | user id |
| user | user id |
| wsid | workstation id |
+----------------------+-------------------------+
还有其他类似的类可用于处理和连接字符串,但不幸的是,其他数据库供应商一无所获-我假设供应商的图书馆有责任提供这种实现。
There are other similar classes for dealing with ODBC and OleDb connection strings, but unfortunately nothing for other database vendors - I would assume the onus is on a vendor's library to provide such an implementation.
这篇关于连接字符串中的Trusted_Connection和Integrated Security有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!