连接字符串中的Trusted_Connection和Integrated Security有什么区别? [英] What is the difference between Trusted_Connection and Integrated Security in a connection string?

查看:64
本文介绍了连接字符串中的Trusted_Connection和Integrated Security有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很好奇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中有一个名为 SqlConnectionStringBuilder ,对于使用类型安全属性来构建字符串的某些部分的 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          |
+----------------------+-------------------------+

(在Reflector的帮助下进行编译)

还有其他类似的类可用于处理 ODBC OleDb 连接字符串,但不幸的是,其他数据库供应商一无所获-我假设供应商的图书馆有责任提供这种实现。

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有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆