这些连接字符串之间的区别? [英] Difference between these connection strings?

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

问题描述

谁能告诉我以下连接字符串之间的有效区别:

Can anybody tell me the effective difference between the following connection strings:

<add key="ConnectionString" value="server=tcp:192.168.0.12\Sqlserver2005;database=;user id=sa;password=;">



<add key="ConnectionString" value="server=192.168.0.12\Sqlserver2005;database=;user id=sa;password=;Network Library=DBMSSOCN;">

我相信两者实际上是相同的。指定 Network Library = DBMSSOCN使用TCPIP显式连接,并在服务器值前加上TCP做同样的事情。

I believe both are effectively the same. Specifying "Network Library=DBMSSOCN" explicitly connects using TCPIP and prefixing server value with TCP does the same thing.

请告诉我是否有任何区别或对性能的影响

Please tell me if there is any difference or any performance implication of specifying these settings in web.config.

推荐答案

这两个选项之间的区别是:

The difference between the two options is:

指定协议

通过使用

多协议= rpc

共享内存= lpc

NWlink IPX / SPX = spx

NWlink IPX / SPX = spx

印度榕树=葡萄藤

Apple Talk = adsp

Apple Talk = adsp

TCP = tcp

TCP = tcp

这是推荐的方式。我也感到它更安全,因为DLL名称比协议名称更容易更改。

This is the recommended way. I also feel its safer as DLL names are likelier to change than protocol names.

它还允许您更改端口号,而不是通过使用全面配置它SQL Server客户端网络实用程序。

It also allows you to change the port number, rather than configuring it across the board by using the SQL Server Client Network Utility.

在没有 dll 扩展名的情况下指定库

Specyfying the Library without the dll extension

指定该库将使用与不带.dll扩展名的实际网络DLL库文件相同的名称。

Specifying the library will use the same name as the actual network DLL library file without the .dll extension.

示例:

TCP / IP:C:\WINDOWS\system32\DBMSSOCN.dll

TCP/IP: C:\WINDOWS\system32\DBMSSOCN.dll

命名管道:C:\ WINDOWS\system32\DBNMPNTW.dll

Named Pipes: C:\WINDOWS\system32\DBNMPNTW.dll

多协议(RPC):C:\WINDOWS\system32\DBMSRPCN.dll

Multiprotocol (RPC): C:\WINDOWS\system32\DBMSRPCN.dll

NWLink IPX / SPX:C:\WINDOWS\system32\DBMSSPXN.dll

NWLink IPX/SPX: C:\WINDOWS\system32\DBMSSPXN.dll

AppleTalk:C:\WINDOWS\system32 MSDBMSADSN.dll

AppleTalk: C:\WINDOWS\system32\DBMSADSN.dll

印度榕树:C:\WINDOWS\system32\DBMSVINN.dll

Banyan VINES: C:\WINDOWS\system32\DBMSVINN.dll

当您要编写自己的网络时,这将最有效ork库。
请参阅SQL Server客户端网络实用程序。

This will work best when you want to write your own network library. Please see SQL Server Client Network Utility.

性能的平衡是微小的,并不引人注目。最好遵循标准并在web.config中进行配置,因为其他开发人员将知道在哪里查找连接设置。类似于在Java中建立数据源连接。

The performance trade-off is minute and not noticeable. It is best to stick to standards and have it configured in the web.config as other developers will know where to look for the connections settings. Similar to having a data-source connection in java.

这篇关于这些连接字符串之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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