Session保存在SQLServer中配置方法:
解释一下 aspnet_regsql.exe表示执行这个文件 ,-U 表示SqlServer的登陆用户名是sa ,-P 表示登陆密码是123456 最后面的sales 是数据库名,即:你要将Session保存到哪个数据库下。
配置webconfig:
<sessionState mode="SQLServer" allowCustomSqlDatabase="true" sqlConnectionString="Data Source=.;Initial Catalog=SessionTest;uid=sa;pwd=123"></sessionState>