代码之家  ›  专栏  ›  技术社区  ›  Peter Oehlert

可信连接和连接字符串中的集成安全性之间有什么区别?

  •  63
  • Peter Oehlert  · 技术社区  · 14 年前

    4 回复  |  直到 10 年前
        1
  •  102
  •   adrianbanks    14 年前

    它们是同义词,可以互换使用。

    在.Net中,有一个类叫做 SqlConnectionStringBuilder 这对于处理

    +----------------------+-------------------------+
    | 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 连接字符串,但不幸的是对其他数据库供应商来说什么都没有——我假设供应商的库有责任提供这样的实现。

        2
  •  11
  •   Cade Roux    14 年前

    它们是一样的。

    服务器/数据源

        3
  •  2
  •   Peter Oehlert    14 年前

    所以过了一会儿我发现了名字冲突的起源。ODBC使用了一组令牌,为OLEDB定义了另一组令牌。对于sqlserver,由于遗留的原因,它们仍然可以互换地支持这两者。

    Trusted\u Connection=true是ODBC,Integrated Security=SSPI是OLEDB。

        4
  •  1
  •   Cordis Audax Agrinova    10 年前