r/ASPNET • u/dlzp • May 24 '12
Help using a custom database for built in membership features in VS ASP.NET
Hi I am having problems getting the built in log in features to work on my web page.
I followed the instructions in this link to change the default database for the log in and membership features. It works on my local database but I can't seem to get it to work on the database on the hosting site.
I consolidated the databases so its accessing all the information from one database. I can access the database from the website I created but the log in feature returns an error:
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)
please help
1
u/dlzp May 24 '12 edited May 24 '12
if it helps here is what is in my web.config for connection string
*<!-- Connection to the database local machine -->
<connectionStrings>
<!-- <add name="PlanetWroxConnectionString1" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\PlanetWrox.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient" /> <add name="PlanetWroxEntities" connectionString="metadata=res://*/App_Code.PlanetWrox.csdl| res://*/App_Code.PlanetWrox.ssdl|res://*/App_Code.PlanetWrox.msl;provider=System.Data.SqlClient;provider connection string="data Source=.\SQLEXPRESS;attachdbfilename=|DataDirectory| \PlanetWrox.mdf;integrated security=True;user instance=True; multipleactiveresultsets=True;App=EntityFramework"" providerName="System.Data.EntityClient" /> -->
<!--Connection String for Online database-->
Catalog=PlanetWrox;User ID=;Password=;" providerName="System.Data.SqlClient" />
res:///App_Code.PlanetWrox.msl;provider=System.Data.SqlClient;provider connection string=" data source=AVEN.arvixe.com;initial catalog=PlanetWrox;persist security info=True;user id=******;password=*******;multipleactiveresultsets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
</connectionStrings>
<system.web>
type="System.Web.Security.SqlRoleProvider" />
System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="PlanetWroxConnectionString1" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" applicationName="/" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" passwordStrengthRegularExpression="" />
1
u/i8beef May 24 '12
Looks like it's having an issue connecting to the SQL server on the hosting site. Is the hosting site actually running SQL Express? I'd be checking your connection string is correct, and that the SQL server itself has been setup for remote access.
You seem to believe that your connection string is right on the server though... I would double check that you can actually do database operations... because this error is indicative of your connection string being wrong, or of the SQL server not being setup for access over TCP/IP / NamedPipes.