SqlConnectionStringBuilder.NetworkLibrary Property


获取或设置一个字符串,该字符串包含用于建立与 SQL Server 的连接的网络库的名称。Gets or sets a string that contains the name of the network library used to establish a connection to the SQL Server.

 property System::String ^ NetworkLibrary { System::String ^ get(); void set(System::String ^ value); };
public string NetworkLibrary { get; set; }
member this.NetworkLibrary : string with get, set
Public Property NetworkLibrary As String

Property Value


NetworkLibrary 属性的值,或者,如果未提供任何值,则为 String.EmptyThe value of the NetworkLibrary property, or String.Empty if none has been supplied.



若要将值设置为 null,请使用 ValueTo set the value to null, use Value.


此属性与连接字符串内的“Network Library”、“network”和“net”键相对应。This property corresponds to the "Network Library", "network", and "net" keys within the connection string.

此属性支持的值包括 dbnmpntw(命名管道)、dbmsrpcn(多协议)、dbmsadsn (AppleTalk)、dbmsgnet (VIA)、dbmslpcn(共享内存)、dbmsspxn (IPX/SPX) 和 dbmssocn (TCP/IP)。Supported values for this property include dbnmpntw (Named Pipes), dbmsrpcn (Multiprotocol), dbmsadsn (AppleTalk), dbmsgnet (VIA), dbmslpcn (Shared Memory) and dbmsspxn (IPX/SPX), and dbmssocn (TCP/IP). 必须在系统上安装您要连接到的相应网络 DLL。The corresponding network DLL must be installed on the system to which you connect. 如果您未指定网络且使用本地服务器(例如“.”或“(local)”),则将使用共享内存。If you do not specify a network and you use a local server (for example, "." or "(local)"), Shared Memory is used.

Applies to

See also