Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Please i get this error when i hosted my asp website to a hosting company.The website runs locally on my local machine but on the internet it brings this error.

Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. 

Parser Error Message: The connection name 'LocalSqlServer' was not found in the applications configuration or the connection string is empty.


Source Error:

HTML
Line 250:    <rolemanager>
Line 251:      <providers>
Line 252:        <add name="AspNetSqlRoleProvider" connectionstringname="LocalSqlServer" applicationname="/" type="System.Web.Security.SqlRoleProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
Line 253:        <add name="AspNetWindowsTokenRoleProvider" applicationname="/" type="System.Web.Security.WindowsTokenRoleProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
Line 254:        <add name="MySQLRoleProvider" type="MySql.Web.Security.MySQLRoleProvider, MySql.Web, Version=6.3.6.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" connectionstringname="LocalMySqlServer" applicationname="/" />

This is my web.config file
HTML
<configuration>
    <system.net>
        <mailsettings>
            <smtp>
                <network host="mail.utoomuch.com" port="25" username="lord123" password="bandamos" />
            </smtp>
        </mailsettings>
    </system.net>
    <!--<connectionstrings>
        <add name="LordsBannerMotorsConnectionString1" connectionstring="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\LordsBannerMotors.mdf;Integrated Security=True;User Instance=True" providername="System.Data.SqlClient" />
    </connectionstrings>-->
    <connectionstrings>
        <add name="LordsBannerMotorsConnectionString1" connectionstring=""Data Source=tcp:s02.winhost.com;Initial Catalog=DB_47628_lordsbanner;User ID=DB_472348_lordsbanner_user;Password=username17;Integrated Security=False;"" />
    </connectionstrings>
    <system.web>
        <trust level="High" />
        <pages>
          
            </assemblies>
        </compilation>
        <authorization>
            <allow users="?" />
        </authorization>
        <authentication mode="Forms">
            <forms loginUrl="~/StaffLogin.aspx">
            </forms>
        </authentication>
        <membership defaultprovider="LordsBannerMotorsSqlMembershipProvider">
         userIsOnlineTimeWindow="15">
            <providers>
                <remove name="AspNetSqlMembershipProvider" />
                <add name="LordsBannerMotorsSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider,                     <br mode=" hold=" />                     System.Web, Version=4.0.0.0, Culture=neutral,                     <br mode=" connectionstringname="LordsBannerMotorsConnectionString1">
                     enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false"
                     applicationName="LordsBannerMotors" requiresUniqueEmail="true"
                     passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7"
                     minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"
                     passwordStrengthRegularExpression="" />
            </add></providers>
        </membership>
        <rolemanager enabled="true" defaultprovider="LordsBannerMotorsSqlRoleProvider">
            <providers>
                <remove name="AspNetSqlMembershipProvider" />
                <add name="LordsBannerMotorsSqlRoleProvider">
                connectionStringName="LordsBannerMotorsConnectionString1"
                     applicationName="LordBannerMotors"
                         type="System.Web.Security.SqlRoleProvider,                       
                     System.Web, Version=4.0.0.0,Culture=neutral, 
                     PublicKeyToken=b03f5f7f11d50a3a" />
            </add></providers>
        </rolemanager>
       

please i will appreciate your help thanks.God bless you as you help me out
Posted
Updated 12-Sep-12 12:44pm
v5

Hi,
You are referring any connection string in in your pages?
Because there is no any connection string in your configuration file and your application is trying to connect to the databse with the connection string LocalSqlServer (Which is not there actually). So, you need to add this connection string to your web.config file.
HTML
<connectionstrings>
    <clear />
    <remove name="LocalSqlServer" />
    <add name="LocalSqlServer" connectionstring="Data Source=tcp:sql.discountasp.net;Initial Catalog=SQL_numid_account;User ID=SQL_numid_user;Password=pw_here">
    providerName="System.Data.SqlClient" />
</add></connectionstrings> 




--Amit
 
Share this answer
 
Comments
jamiebones 12-Sep-12 3:41am    
I have done what you said i should do now the new error message is The connection name 'LordsBannerMotorsConnectionString1' was not found in the applications configuration or the connection string is empty.please thanks for your time in helping me
_Amy 12-Sep-12 4:36am    
Rename the name of connection string in web.config from LocalSqlServer to LordsBannerMotorsConnectionString1. And make sure that your connectionstring path is correct.
All you need to do is to add the attribute <clear> to the profile provider ,role manager provider and the membership provider.Doing this overides the default property which inherits from the machine.config file of the machine.

<rolemanager enabled="true" defaultprovider="LordsBannerMotorsSqlRoleProvider">
<providers>
<clear>
<remove name="AspNetSqlMembershipProvider">
<add name="LordsBannerMotorsSqlRoleProvider">
connectionStringName="LordsBannerMotorsConnectionString1"
applicationName="LordBannerMotors"
type="System.Web.Security.SqlRoleProvider,
System.Web, Version=4.0.0.0,Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a" />

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900