I have created new session database using the command (aspnet_regsql.exe -S -E -ssadd -sstype p) and it created DB called ASPState. Then I renamed it to something like E_ASPStateDB. I have configured the correct DB name in the sessionState connection string. But still it throws the exception Invalid object name 'ASPState.dbo.ASPStateTempApplications'
What i need to do, so that it will use the new database name?
I ran this on the db server that the site was connecting to and it solved it immediately.
USE [ASPState]
GO
DECLARE @return_value int
EXEC @return_value = [dbo].[CreateTempTables]
SELECT 'Return Value' = @return_value
GO
You must modify the stored procedures because they invoke the tables with the database name and schema, as follows:
[ASPState].dbo.ASPStateTempApplications
you have to change it for
[E_ASPStateDB].dbo.ASPStateTempApplications
Since you renamed the DB you will have to regenerate the ASPnet session tables. Below is the solution to it.
To Remove, use following command: [open visual studion command prompt]
aspnet_regsql -ssremove -S [SERVER] -U [USER] -P [PWD] -d [DATABASE] -sstype c
Then add them again by following command
aspnet_regsql -ssadd -S [SERVER] -U [USER] -P [PWD] -d [DATABASE] -sstype c
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With