Wednesday 31 July 2013

Cannot open database "Database" requested by the login. The login failed. Login failed for user 'ServerName\UserName'.


Server Error in '/Ajax-CascadingDropdownlist' Application.

Cannot open database "Cascading_ddl" requested by the login. The login failed.
Login failed for user 'Kasani-I3\Rack'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Cannot open database "Cascading_ddl" requested by the login. The login failed.
Login failed for user 'KONALA6666-I3\Vamsi'.

Source Error:


Line 32:             {
Line 33: cmd.Connection = con;
Line 34: con.Open();
Line 35: ddl.DataSource = cmd.ExecuteReader();
Line 36: ddl.DataTextField = text;

Source File: c:\Documents and Settings\Vamsi\My Documents\Downloads\Ajax-CascadingDropdownlist\CS.aspx.cs    Line: 34 



Solution:  Check The Connection String That You Had Given In Web.Config.
It Should Be As :
<connectionStrings>
  <add name=" ConnectionString " connectionString="user id=sa;database=Your Database Name;data source=Your Server Name;password=Your Password;integrated security=SSPI;Persist Security Info=True" providerName="System.Data.SqlClient"/>
</connectionStrings>

No comments:

Post a Comment

Note: only a member of this blog may post a comment.