I have the same problem. I have a working DNN install on SBS2003 Server with SQL 2005.
I needed a demo machine so I setup a laptop with windows xp and SQLExpress 2008 as the only instance on the machine.
Installed the database by doing an SQL restore and reset user permissions for ASPNET.
I get the same error as above, sometimes i get the UnderConconstruction.html page.
HERE's WHAT I DID!
I created a simple DBtest.aspx page with debug set to on in the DNN web root directory. But it too would not load and it posted the same error as above.
I stopped the IIS DNN web site and created a new site (using IISAdmin.exe which allows for creation of multiple sites on IIS Xp)
I copied the Dbtest.aspx to new site and opened a browser. All worded and the DBTest.aspx file listed the contents of the DNN database "Affiliates" table.
ok, so back to DNN installation.it seem the whole site will not initialise with SQLExpress 2008 - i checked code in global.aspx but it inherits DotNetNuke.Common.Global and I don't have the source code to check the startup process.
It's definately a DNN thing and not SQL Express as on same machine I can access the DNN data from other websites, via odbc and access and SQL management studio.
My connections strings are correct and do work on other sites. The original site from the data is working on 2005 server..
NOW - HERE'S SOMETHING REALLY STRANGE THAT MAY HELP FIND THE DNN ERROR
On the working machine (2003 server / sql 2005) I installed SQLExpress 2008 as new instanace [servername\SQLExpress].
I detached the DNN database and stopped SQL2005 instance. I then attached to SQLExpress, added the logins etc and then updated the working web.config file to reflect the instance name - that was all - nothing else changed
Guess what!!!!
DNN would not start - if I point to http://localhost i get undercontruction.html but if i point to http://localhost/default.asp i get the error as above.
SO I restarted the SQL2005 instanace and reattached the database (now i have 2 instances and 2 databases with the same name but on different instance)
DNN now works, but updates the SQL2005 database even though the instance name in the web.config file poinst to another database.
After lots of changes to the SQL setup I got it to work but only just. The SQL2005 instance has to be up and running with a database loaded and with the same security credentials - if that instance is stopped (even though it not actually being used) it will prevent the login to the SQL2008 instance. And it's only DNN websites that have the problem as other ASp.NET sites on the same machine work and can access the DNN Database using the exact same connection string.
Here's the script to test the DB Connection
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ Page Language="VB" Debug="true" Trace="true" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.Sqlclient" %>
<script runat="server">
Sub Button1_Click(sender As Object, e As EventArgs)
Trace.Write ("Click", "Start")
Dim conn As New _
SqlConnection("Server=macro-server\SQLExpress;Database=macrodnn;Trusted_Connection=true")
Dim cmd As New SqlCommand("select * FROM Affiliates", conn)
Try
Trace.Write("Opening connection")
Conn.Open()
DataGrid1.DataSource = cmd.ExecuteReader(CommandBehavior.CloseConnection)
DataGrid1.DataBind()
Catch ex As Exception
Trace.Warn(ex.Message)
Label1.Text = "Could not connect to the database - " & _
"please try again later."
End Try
End Sub
</script>
<html>
<head>
</head>
<body>
<form runat="server">
<asp:Button id="Button1" onclick="Button1_Click" runat="server" Text="Button"></asp:Button>
<asp:DataGrid id="DataGrid1" runat="server"></asp:DataGrid>
<asp:Label id="Label1" runat="server">Label</asp:Label>
<!-- Insert content here -->
</form>
</body>
</html>