Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeGetting StartedGetting StartedInstalling DNN ...Installing DNN ...Cannot connect to SQLExpressCannot connect to SQLExpress
Previous
 
Next
New Post
7/15/2009 11:55 PM
 

I am moving my DNN to a new computer. I copied the directory over to the wwroot, set up the website and ran http://localhost/DNN/Install/InstallWizard.aspx  When I get to the Configure Database Connection page I receive the following error when testing the connection,

Connection Error(s):
Index #: 0
Source: .Net SqlClient Data Provider
Class: 20
Number: -1
Message: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

Any Ideas?

Thanks for all who have helped me in the past. I cannot do it without you.

W D Federation

 

 
New Post
7/16/2009 4:56 AM
 

if you encouter the database wizard, there is an error with your configuration, this should only show up on initial installation of a site.

before moving, if you want/need to use a different domain name, add it as new portal alias in Host :: Portals or Admin :: Site Settings

Next, please re-copy your web.config to your new site. Open it with a text editor and modify both uncommented connection strings according to your new database location.


Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
7/17/2009 2:22 AM
 

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>
 

 

 

 

 

 

 

 
Previous
 
Next
HomeHomeGetting StartedGetting StartedInstalling DNN ...Installing DNN ...Cannot connect to SQLExpressCannot connect to SQLExpress


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out