0

I have published my website to a webhost but i have some serious database problems. This is my errors

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.

Line 255:            <providers>
Line 256:                <add name="AspNetSqlMembershipProvider"
Line 257:                    type="System.Web.Security.SqlMembershipProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
Line 258:                    connectionStringName="LocalSqlServer"
Line 259:                    enablePasswordRetrieval="false"
Source File: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config    Line: 257 

This is the connection string to my host :

<connectionStrings>
    <remove name="LocalSqlServer" />
    <add name="SiteSqlServer" connectionString="Server=(localhost);Database=ulprojec_******-***;uid=ulprojec_***;pwd=********a;" />   

</connectionStrings>

And this is my membership connection string which i got from microsoft's website but it still makes the first error occur:

<membership defaultProvider="SiteSqlServer"
      userIsOnlineTimeWindow="15">
      <providers>
        <add 
          name="SiteSqlServer" 
          type="System.Web.Security.SqlMembershipProvider" 
          connectionStringName="SiteSqlServer"
          applicationName="georgi-it"
          enablePasswordRetrieval="false"
          enablePasswordReset="true"
          requiresQuestionAndAnswer="true"
          requiresUniqueEmail="false"
          passwordFormat="Hashed"
          maxInvalidPasswordAttempts="5"
          passwordAttemptWindow="10" />
      </providers>
    </membership>

I would really really really apreciate any help as i am desperate already.

EDIT: I Sorted this out

I have this issue now:

Exception Details: System.ArgumentException: Invalid value for key 'attachdbfilename'.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
2
  • Have you seen this? Commented Mar 11, 2013 at 23:47
  • I assume you've looked and your config file doesn't contain the string "attachdbfilename"? That sounds like part of a connection string. Commented Mar 12, 2013 at 0:58

2 Answers 2

1

Well if the error is the one that you are receiving this means that you are using connection string "LocalSqlServer" in the following piece:

<providers>
Line 256:                <add name="AspNetSqlMembershipProvider"
Line 257:                    type="System.Web.Security.SqlMembershipProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
**Line 258:                    connectionStringName="LocalSqlServer"**
Line 259:                    enablePasswordRetrieval="false"

And here you are making a remove to the connection string.

<connectionStrings>
    **<remove name="LocalSqlServer" />**
    <add name="SiteSqlServer" connectionString="Server=(localhost);Database=ulprojec_******-***;uid=ulprojec_***;pwd=********a;" />   

</connectionStrings>

I think you can see that you have a simple naming issue with the connection string.

Sign up to request clarification or add additional context in comments.

1 Comment

yeah i figured that out, but now i have another issue
0

If you are not using membership features, remove the membership, profile and roleManager tags from system.web section of the root web.cofig file. This helped me to resolved the issue.

1 Comment

What exactly should be removed and from where?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.