Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 422
  • Last Modified:

Can Someone Decipher this Stack Trace Message

I have the ASP.NET Portal VBVS Starter Kit Running on a Web server connected to a SQL 2000 remote DB.  I have staged a new SQL 2005 server and have ran the scripts to create the DB and restored the data from the SQL 2000 server.  I changed the web.config file to point to the new SQL 2005 server and below is what I get.  I have changed the password to the default, however still won't go.  Any thoughts...


Cannot open database "Portal" requested by the login. The login failed. Login failed for user 'PortalUser'.
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 "Portal" requested by the login. The login failed. Login failed for user 'PortalUser'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace:


[SqlException: Cannot open database "Portal" requested by the login. The login failed.
Login failed for user 'PortalUser'.]
   System.Data.SqlClient.ConnectionPool.CreateConnection() +402
   System.Data.SqlClient.ConnectionPool.UserCreateRequest() +151
   System.Data.SqlClient.SqlConnection.Open() +384
   ASPNET.StarterKit.Portal.LinkDB.GetLinks(Int32 moduleId)
   ASPNET.StarterKit.Portal.QuickLinks.Page_Load(Object sender, EventArgs e)
   System.Web.UI.Control.OnLoad(EventArgs e) +67
   System.Web.UI.Control.LoadRecursive() +35
   System.Web.UI.Control.LoadRecursive() +98
   System.Web.UI.Control.LoadRecursive() +98
   System.Web.UI.Control.LoadRecursive() +98
   System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction) +464
   System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) +372
   System.Data.SqlClient.SqlConnection.Open() +384
   ASPNET.StarterKit.Portal.LinkDB.GetLinks(Int32 moduleId)
   ASPNET.StarterKit.Portal.QuickLinks.Page_Load(Object sender, EventArgs e)
   System.Web.UI.Control.OnLoad(EventArgs e) +67
   System.Web.UI.Control.LoadRecursive() +35
   System.Web.UI.Control.LoadRecursive() +98
   System.Web.UI.Control.LoadRecursive() +98
   System.Web.UI.Control.LoadRecursive() +98
   System.Web.UI.Page.ProcessRequestMain() +750

 
0
jimmyjamrmh
Asked:
jimmyjamrmh
  • 2
1 Solution
 
samtran0331Commented:
There really isn't anything to decipher that is necessary beyond:
[SqlException: Cannot open database "Portal" requested by the login. The login failed.
Login failed for user 'PortalUser'.]


>> I changed the web.config file to point to the new SQL 2005 server and below is what I get.
Is there a user in the SQL2005 users named "PortalUser"? (which I assume is what is in your web.config connectionstring?)
0
 
jimmyjamrmhAuthor Commented:
I was able to fix.  I found that a previous PortalUser had attached to the DB, thus not letting the new PortalUser append to the Portal DB.  I deleted both and reran the script, tweaked the permissions and it worked.  Weird!
0
 
samtran0331Commented:
That was actually going to be my next suggestion...wanted to get the basics of making sure the username/password in Sql server and web.config were correct first...

the reason is that the logins are maintained for every database in the master database on the server and it also includes a SID (security identifier)...so when you move db's from server to server the data in the master database doesn't match up the SID even though the username might be the same because the SID is created for the sql server....dropping the user and re-adding it creates a new SID to match..
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now