An error has occurred while establishing a connection to the server.

I'm using VWD Express 2005 which uses sql server 2005.  Web site works fine on local host but when I use FTP to copy to server (a shared server at I get this error message when I try to open a page which requires database interaction in my browser.  (see it at  I have gone into sql server 2005 and configured it for local and remote connections instead of local connections but still no luck.  I believe the problem has to do with the connectionstringname in the web.config file but I don't know why.  Something to do with "LocalSqlServer" ?

<configuration xmlns="">
  <add name="ASPNETDBConnectionString1" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASPNETDB.MDF;Integrated Security=True;User Instance=True"
   providerName="System.Data.SqlClient" />
  <add name="ConnectionString" connectionString="Expression: SampleData"
   providerName="System.Data.SqlClient" />
    <trace enabled="true" localOnly="false" />
    <compilation debug="true" />
    <roleManager enabled="true"/>
        <add namespace="System"/>
        <add namespace="System.Collections"/>
        <add namespace="System.Collections.Specialized"/>
        <add namespace="System.Configuration"/>
        <add namespace="System.Text"/>
        <add namespace="System.Text.RegularExpressions"/>
        <add namespace="System.Web"/>
        <add namespace="System.Web.Caching"/>
        <add namespace="System.Web.SessionState"/>
        <add namespace="System.Web.Security"/>
        <add namespace="System.Web.Profile"/>
        <add namespace="System.Web.UI"/>
        <add namespace="System.Web.UI.WebControls"/>
        <add namespace="System.Web.UI.WebControls.WebParts"/>
        <add namespace="System.Web.UI.HtmlControls"/>
       <authentication mode="Forms"/>
        <remove name="AspNetSqlMembershipProvider"/>
        <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="LocalSqlServer" minRequiredPasswordLength="5" minRequiredNonalphanumericCharacters="0" passwordStrengthRegularExpression=""/>
        <add name="FirstName"/>
        <add name="LastName"/>
        <add name="Address1"/>
        <add name="Address2"/>
        <add name="City"/>
        <add name="State"/>
        <add name="Zip"/>
        <add name="Phone"/>
        <add name="Email"/>
        <add name="ID"/>
    <customErrors mode="Off"/>
Who is Participating?
That is all you have to retrive from godaddy.
When you host web site they will have their help pages and knowledgebase where you can find out how to setup your database for your web site.

Check this link.

Hope it helps
Where you are trying to host your application ? If on any server than you have to change the connection string. You might also have to create the database on the server where you are copying the application.
PrimeNYAuthor Commented:
Thanks for your comment.  Web site is being hosted by  Change connection string (where) in web.config to what?  What is involved to create database?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.