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

  • Question

  • User107276062 posted

    I have hosted MVC application (membership) on web server and when run I got error.

    Error:

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

    Solution:

    Nothing to do just Simply Add  

    <add name="LocalSqlServer" connectionString="Data Source=YourServerName;Integrated Security=true;Initial Catalog=YourDataBaseName" providerName="System.Data.SqlClient" />

    this section in your webConfig file under <ConnectionString> Tag

    Wednesday, August 5, 2015 2:32 PM

All replies

  • User2024324573 posted

    Does your tag in Web.Config look like below:

    <connectionStrings>
        <add name="LocalSqlServer" connectionString="Data Source=(LocalDb)\v11.00;;Initial Catalog=aaaaaaaaaaa;Integrated Security=True"
          providerName="System.Data.SqlClient" />
      </connectionStrings>

    Thanks

    Wednesday, August 5, 2015 4:41 PM
  • User107276062 posted

    Yes, it looks like as below,

    <connectionStrings>
        <add name="LocalSqlServer" connectionString="Data Source=10.10.10.10;Initial Catalog=DatabaseName;user id=abcd;password=abcd"
          providerName="System.Data.SqlClient" />
      </connectionStrings>

    Please let me know if you are facing issue still.

    Thursday, August 6, 2015 2:15 AM