【问题标题】:How to fix the web.config connection string which always default to SQL Server Express如何修复始终默认为 SQL Server Express 的 web.config 连接字符串
【发布时间】:2012-08-12 13:09:13
【问题描述】:

我正在使用 VS 2010 和 SQL Server 2008 R2。我的挑战是如何修复默认为SQLEXPRESSweb.config

我的数据库在 SQL Server 2008 R2 上。我希望我的连接字符串指向 SQL Server R2。该服务器在我的本地机器上,但是在我安装 VS 2010 时安装了 SQLEXPRESS

【问题讨论】:

    标签: sql-server asp.net-mvc visual-studio-2010 connection-string


    【解决方案1】:

    当您使用SqlExpress 时,您的连接字符串如下所示:

    Data Source=.\SqlExpress
    

    替换为:

    Data Source=localhost
    

    如果你的实例有名字(不是默认实例,需要在设置中定义):

    Data Source=localhost\instanceName
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多