Solved

Can Someone Decipher this Stack Trace Message

Posted on 2008-10-24
4
412 Views
Last Modified: 2013-11-07
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
Comment
Question by:jimmyjamrmh
  • 2
4 Comments
 
LVL 37

Expert Comment

by:samtran0331
ID: 22799771
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
 
LVL 1

Accepted Solution

by:
jimmyjamrmh earned 0 total points
ID: 22799842
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
 
LVL 37

Expert Comment

by:samtran0331
ID: 22800074
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now