【问题标题】:How to remove sessionState sqlConnectionString duplication如何删除 sessionState sqlConnectionString 重复
【发布时间】:2019-04-24 15:24:05
【问题描述】:

我在 web.config 的标准 connectionStrings 元素中有一组连接字符串

web.config 中的 sessionState 元素规定在使用 sql 会话状态时使用 sqlConnectionString 属性。

这通常会导致连接字符串在文件中的两个位置重复,如果有人忘记更改这两个位置,可能会导致它们不同步。

我可以使用什么机制来删除这种重复?

示例配置:

<connectionStrings>
    <add name="IWouldLikeToUseThisConnectionStringForSessionState" value="..."
</connectionStrings>

<sessionState 
    mode="SQLServer" 
    allowCustomSqlDatabase="true"
    sqlConnectionString="DuplicatedConnectionStringHereAndCanGetOutOfSync"
    />

【问题讨论】:

    标签: asp.net


    【解决方案1】:

    处理此问题的一种方法可能是使用Partioning,如here 所述。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-04-19
      • 1970-01-01
      • 2020-09-27
      • 1970-01-01
      • 1970-01-01
      • 2019-05-27
      • 2010-12-17
      相关资源
      最近更新 更多