[转】[tip] localhost vs. (local) in SQL Server connection strings
主要区别在于连接协议不同,前者(localhost)使用TCP协议,后者(“(local)”)使用NamedPipe协议。
Sample code with SQL Server connection strings often use localhost and (local) interchangeably. They're different.
Server=(local);Database=DotNetNuke;Trusted_Connection=True
Uses named pipesServer=localhost;Database=DotNetNuke;Trusted_Connection=True
Uses a TCP port negotiated on port 1434 udp, which defaults to 1433