|
I have searched everywhere for answers to this but none of the posts I have read have helped yet.
My website works perfectly until I upload it onto a remote web host. When this happens the logisn don't work.
I am using the built in ASPNETDB.MDF database. I get the following error:
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
I attach an almost complete extract of the web.config file, with the username and password of the live server changed for security reasons:
<connectionStrings>
<!--<add name="tmddb_conn" connectionString="Server=gidesktop\sqlexpress; database=underground; Integrated Security=True" providerName="System.Data.SqlClient"/>-->
<add name="tmddb_conn" connectionString="Server=db.ladarnas.com; database=ladarnas_underground; uid=UID; pwd=PWD" providerName="System.Data.SqlClient"/>
<add name="LocalSqlServer" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspn etdb.mdf;User Instance=true" providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
<roleManager enabled="true" />
<compilation debug="true" />
<customErrors mode="Off" />
<!--<customErrors mode="On" defaultRedirect="Error.aspx"/>-->
<authentication mode="Forms">
<forms loginUrl="Login.aspx" timeout="20" />
</authentication>
<membership defaultProvider="CustomizedProvider">
<providers>
<clear />
<add name="CustomizedProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="LocalSqlServer"
requiresQuestionAndAnswer="false"
requiresUniqueEmail="true"
passwordFormat="Hashed"
minRequiredNonalphanumericCharacters="0"
minRequiredPasswordLength="3"
applicationName="underground" />
</providers>
</membership>
<siteMap defaultProvider="XmlSiteMapProvider" enabled="true">
<providers>
<add name="XmlSiteMapProvider"
description="Default SiteMap provider."
type="System.Web.XmlSiteMapProvider"
siteMapFile="Web.sitemap"
securityTrimmingEnabled="true" />
</providers>
</siteMap>
</system.web>
<location path="Reports">
<system.web>
<authorization>
<allow roles="Administrator"/>
<deny users="*"/>
</authorization>
</system.web>
</location>
<location path="Admin">
<system.web>
<authorization>
<allow roles="Administrator"/>
<deny users="*"/>
</authorization>
</system.web>
</location>
I can acheive great programming tasks and yet I am broken by database connections every time :). Databases are the best thing in the world, but they can also be the bain of your life when you can't find a solution.
I incidentally cannot open the ASPNETDB.MDF database to check if it is configued correctly as it's not possible to open it using SQL Server Manager as it is simply an attached database instance in the ASP aplication.
I'm sure I could probably avoid this by dealing with security in the main application database. But on principle if they provide an integrated fcaility to deal with this, why shouldn't I be able to use it??
Any asistance would be greatly appreciated.
Kind Regards,
Ian
|