“服务器"与“数据源"在连接字符串中 [英] "Server" vs "Data Source" in connection string

查看:91
本文介绍了“服务器"与“数据源"在连接字符串中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是SqlServer的新手,现在我已安装SqlLocalDb以便在本地工作.很好,但是我通常可以看到两个连接字符串,并且都可以正常工作:

I'm new to SqlServer, right now I have SqlLocalDb installed to work locally. Good, but I can see two connection strings typically and both works:

Data Source=(localdb)\v11.0;Integrated Security=true;

Server=(localdb)\v11.0;Integrated Security=true;

两者之间有什么确切的区别?

What exact difference is there between the two?

推荐答案

有关所有连接字符串关键字的完整列表,包括完全同义的关键字,请参考

For the full list of all of the connection string keywords, including those that are entirely synonymous, please refer to the SqlConnection.ConnectionString documentation:

这些都是完全等同的:

  • 数据源
  • 服务器
  • 地址
  • 地址
  • 网络地址
  • Data Source
  • Server
  • Address
  • Addr
  • Network Address

这篇关于“服务器"与“数据源"在连接字符串中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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