在Sessionstate中配置SQL Server模式 [英] Configuration for SQL Server mode in Sessionstate

查看:123
本文介绍了在Sessionstate中配置SQL Server模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Web.config中为''SqlServer''模式配置会话状态





我试过以下但是我得到了错误请帮帮我,提前谢谢。



Web.Config:

How to configure session state for ''SqlServer'' Mode in Web.config


I tried the following but iam getting error please help me on this, Thanks in advance.

Web.Config:

<system.web>
        <compilation debug="true" targetFramework="4.0" />
      <sessionState cookieless="false" mode="SQLServer"  sqlConnectionString="Data Source =localhost;Initial Catalog =sample;User ID = VIGNESHJ\Admin;password=viki;Integrated Security=true;"></sessionState>
 </system.web>







Error:

Server Error in '/' Application.
--------------------------------------------------------------------------------

Configuration Error

Source Error:


Line 9:      <system.web>
Line 10:         <compilation debug="true" targetFramework="4.0" />
Line 11:       <sessionState cookieless="false" mode="SQLServer"  sqlConnectionString="Data Source =localhost;Initial Catalog =sample;User ID = VIGNESHJ\Admin;password=Viki;Integrated Security=true;"></sessionState>
Line 12:     </system.web>
Line 13:

推荐答案

指定自定义数据库时,需要将allowCustomSqlDatabase属性设置为true在SessionState的sqlConnectionString属性中。或者,您可以从连接字符串中删除初始目录规范,以便ASPState默认数据库用于会话管理。
You will need "allowCustomSqlDatabase" property to be set to "true" when specifying a custom database in your "sqlConnectionString" attribute for SessionState. Or you can remove the "initial catalog" specification from your connection string so that "ASPState" default database is used for session management.


这篇关于在Sessionstate中配置SQL Server模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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