连接字符串中数据源=(本地)后的逻辑 [英] Logic behind data source=(local) in connection string

查看:76
本文介绍了连接字符串中数据源=(本地)后的逻辑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的开发计算机上有两个SQL Server 2008 Express实例和一个SQL Server 2012实例.我们正在开发一个ASP.NET MVC应用程序,并使用表达式data source =(local);在Web.config中的connectionString内部.

I have two instances of SQL Server 2008 Express and one instance of SQL Server 2012 on my development machine. We're developing an ASP.NET MVC application and use the expression data source=(local); inside of our connectionString in Web.config.

现在我的问题是,该表达式背后的逻辑是什么?选择哪个实例,以及如何更改此行为?

Now my question is what is the logic behind this expression? Which instance gets chosen and how can I change this behavior?

推荐答案

使用本地"将获得默认实例,该实例通常为非Express SQL Server,因为默认情况下,在SQL Server Express安装中,实例名称为"SQLEXPRESS"并且在默认情况下,在完整的SQL Server安装中,除非明确设置实例名称,否则不会获得实例名称.

Using "local" you get the default instance which is usually the non-express SQL Server since by default in SQL Server Express installation the instance name is "SQLEXPRESS" and in full SQL Server installation by default you don't get an instance name unless you set it explicitly.

这篇关于连接字符串中数据源=(本地)后的逻辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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