I am trying to add session state to SQL Server and I am unable to get it to work.
I first tried adding following connection string into the config:
sessionState mode="SQLServer"
sqlConnectionString="Server=XXXXXX;Database=ASPState;Integrated Security=true"
And get the following error:
The sqlConnectionString attribute or the connection string it refers to cannot contain the connection options
Database
,Initial Catalog
orAttachDbFileName
. In order to allow this, allowCustomSqlDatabase attribute must be set to true and the application needs to be granted unrestricted SqlClientPermission. Please check with your administrator if the application does not have this permission.
I then tried adding allowCustomSqlDatabase="true"
to the connection string and get the following error:
System.Data.SqlClient.SqlException: Invalid object name 'tempdb.dbo.ASPStateTempApplications'.
This looks like it is trying to connect to the tempdb
and not ASPState
database.
Any ideas how to get this to use the ASPState database?
Cheers
Andy