【问题标题】:Missing required whitespace from connection string in Web.configWeb.config 中的连接字符串中缺少必需的空格
【发布时间】:2013-04-01 21:21:28
【问题描述】:

我的连接字符串如下所示:

<add name="RaiseFantasyLeagueConnectionString" connectionString="Server=ATLAS-SQL-07;Database=Raise;MultipleActiveResultSets="True" User Id=***; Password=*******/>

我在MultipleActiveResultSets="True" 说时遇到错误

缺少必需的空格。

谁能建议我做错了什么?

【问题讨论】:

  • SO 上的突出显示告诉你答案。

标签: asp.net .net web-config connection-string whitespace


【解决方案1】:

此连接字符串有多个问题。

  • 不应引用MultipleActiveResultSets=True 中的True 值
  • MultipleActiveResultSets=True后面应该有分号
  • 密码后应该有一个结束引号。

试试这样:

<add name="RaiseFantasyLeagueConnectionString" connectionString="Server=ATLAS-SQL-07;Database=Raise;MultipleActiveResultSets=True;User Id=***;Password=*******"/>

【讨论】:

    【解决方案2】:

    加分号

    MultipleActiveResultSets="True"; User Id=
                                   ^
                                   |
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-08-15
      • 1970-01-01
      • 2012-06-18
      • 1970-01-01
      相关资源
      最近更新 更多