Click here to Skip to main content
15,888,521 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Things I did so far,

Step 1:
In web.config,
HTML
<system.web>
		<sessionState mode="SQLServer" sqlConnectionString="data source=KOTTA;uid=sa;pwd=asdf"></sessionState>
	</system.web>

Step2:
In ms sql, created a database named 'SessionMgmt'.

Step3:
Run 'aspnet_regsql.exe' by double clicking it in the location,
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\
and in it, set server=KOTTA, Username=sa, Password=asdf and select Database as SessionMgmt

On running the project, I get the error,
Cannot open database "ASPState" requested by the login. The login failed.
Login failed for user 'sa'. 



Please help me.........
Posted
Updated 25-Dec-11 22:31pm
v5

Step 1:
In web.config,
C#
<system.web>
<sessionState mode="SQLServer" allowCustomSqlDatabase="true" sqlConnectionString="server=KOTTA;database=SessionMgmt;uid=sa;pwd=asdf"></sessionState>
	</system.web>


Step2:
In ms sql, created a database named 'SessionMgmt'.

Step3:
Run 'aspnet_regsql.exe' using command prompt with following command lines,

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regsql -d SessionMgmt -S KOTTA -U sa -P asdf -ssadd -sstype c

-----------------------------------------------------------------------------------------------------------------------

[^]This link really helped me
 
Share this answer
 
v5
aspnet_regsql defaults to using SQLExpress. Check that first. If you have SQL Management console installed then verify the databases.

Most importantly though, you should not be using the SA account for anything.
 
Share this answer
 
I completely agree with mark about not using sa account. however there can be one more reason for this problem and it's related to authentication mode of SQL server. if the installation only support windows authentication then above connection string will not work. for details you can have a look at
http://msdn.microsoft.com/en-us/library/ms144284.aspx[^] and

http://msdn.microsoft.com/en-us/library/ms188670.aspx[^]
 
Share this answer
 
Comments
N!dh!sh 26-Dec-11 1:21am    
Hi,
My installation support both windows and sa authentication. Could you plz suggest some other solution.
AmitGajjar 26-Dec-11 1:29am    
check if your newly created database have rights for sa. check from permission options.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900