The connection name 'LocalSqlServer' was not found

Discussion in 'General troubleshooting' started by bash, Apr 13, 2010.

  1. what should i do to solve it ?

    Server Error in '/' Application.
    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:

    [No relevant source lines]


    Source File: machine.config Line: 160

    Version Information: Microsoft .NET Framework Version:2.0.50727.4200; ASP.NET Version:2.0.50727.4016
     
  2. Ray

    Ray

    Your application is trying to connect to a database looking for this name "LocalSQLServer" and you probably do not have it defined on the applications web.config file.

    Try adding this line in your applications web.config file, it should be under the connection string element.

    <add name="LocalSqlServer" connectionString="Data Source=DBServerName;Integrated Security=false;Initial Catalog=DBName;User ID=DBLogin;Password=DBPassword" providerName="System.Data.SqlClient" />

    Make sure you replace the values with your own such as the source name which is the SQL server you will be connecting to.
     
  3. a 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 entry 'LocalSqlServer' has already been added.


    emm !!

    by the way I am using SQL server 2005
     
  4. Ray

    Ray

    Drop that connection string I told you to create. Go back to your applications web.config and look for the connection string nameed "LocalSQLServer" and define it properly. Use the example of the connection string I showed you to define it properly.

    You may also want to check the root folder and check your web.config file there and make sure it is coded correctly for "LocalSQLServer".
     
  5. there is only one "LocalSQLServer" which you told me to add
     
  6. Ray

    Ray

    It might also be on the root. Try this instead of going through your web.config file, try using the IIS 7 Manager. The IIS 7 Manager gives you a GUI look in which you can define the connection string element.

    Use this kb article to get IIS 7 Manager and configure it to connect to our server. Than, once you are connected go to a butto/icon that is labeled "Connection Strings". You should be able to setup or create the connection string name "LocalSQLSserver" from there.

    http://support.Winhost.com/KB/a628/using-the-microsoft-iis-70-manager.aspx
     
    Last edited by a moderator: Oct 14, 2015
  7. Thank you.

    Just wanted to share my experience with this error to assure others they are not alone.

    My site has been up and running for a few months with no problems. Within the past few days (around April 17th) my site started failing with the "connection name 'LocalSqlServer' was not found" error.

    Some update to the server must have triggered the change, because I haven't touched the site files in weeks.

    Anyway - The instructions above are perfect. Download and install the IIS 7 Manger. Go to the Connection Strings and (what I saw) there is an entry there for 'LocalSqlServer' that points to a SQLEXPRESS database or something like that. I just changed the settings to point to my database and the site works now.

    I am a little concerned that apparently something new wants to connect to a database. I'd like to hear how many others had this happen to them.
     
  8. That is correct. One server was not configured as the others as far as this issue is concerned, so we made changes to bring it into our standard configuration. Hence the error for some people.

    Sorry about that. We take a lot of care to insure standardization, but occasionally a small configuration issue such as this will go by undetected. Fixing it can cause problems for those who have been using the previous non-standard config.
     
  9. Thanks for the followup. I appreciate it.

    Winhost has been great for me so far.
     

Share This Page