'LocalSqlServer' error and how to fix this

Discussion in 'Databases' started by hugovermaak, Mar 11, 2012.

  1. Hi,

    I am new to Winhost and just attempted to deploy a website, I am however getting the following error:

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

    I added this: <remove name="LocalSqlServer" /> to my connection strings and still it is not working.

    Another suggestion was to fix this error through IIS 7 Manager, which I cannot install since I am running on Windows 7 Home Basic.

    I am developed and deployed with WebMatrix and I am using a SQL CE 4 database

    Below is my full web.config

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
      <system.web>
        <compilation debug="true" targetFramework="4.0" />
      </system.web>
        <connectionStrings>  
            <remove name="LocalSqlServer" />  
        </connectionStrings>
        <system.data>
            <DbProviderFactories>
                <remove invariant="System.Data.SqlServerCe.4.0" />
                <add invariant="System.Data.SqlServerCe.4.0" name="Microsoft® SQL Server® Compact 4.0" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
            </DbProviderFactories>
        </system.data>
        <system.webServer>
            <defaultDocument>
                <files>
                    <add value="Default.cshtml" />
                </files>
            </defaultDocument>
        </system.webServer>
    </configuration>
    Please help me out
     
    Last edited by a moderator: Oct 14, 2015
  2. Last edited by a moderator: Oct 14, 2015
  3. ComputerMan

    ComputerMan Winhost Staff

    Cool! Glad you solved your issue. Thank you for posting the link that worked for you too :)
     

Share This Page