locked
Unable to publish site because of missing database connection strings in Publish Settings. RRS feed

  • Question

  • User-519976378 posted

    I used the same connection string for navicat to so that I could put the database onto azure, I have now connected to that database in webmatrix, I've tried to publish the site but I am getting "Unable to publish site because of missing database connection strings in Publish Settings."

    I have checked the connection settings inside web.config and everything looks ok to me.

    EDIT: I've deleted a local database which just contained the same files as which were on the azure server, is this local database important or can I just create a connection string with php and display files.

    Wednesday, April 8, 2015 7:43 PM

Answers

  • User-1078840699 posted

    Hello,

    Change your web.config file to include

    providerName="System.Data.SqlClient"

    as an attribute on the connection string like this and also do check this link

      <connectionStrings>
          <add name="ConnString" connectionString="Data Source=IP_OF_SERVER,PORT; Initial Catalog=DATABASE_NAME; UID=USERNAME; pwd=PASSWORD; Integrated Security=True;" providerName="System.Data.SqlClient" />
      </connectionStrings>


    Another Example:

    <connectionStrings>
    <clear/>
    <add name="LocalSqlServer" connectionString="Data Source=remotehost;Initial Catalog=remoteDB;User Id=username;Password=password" providerName="System.Data.SqlClient" />
    </connectionStrings>
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, April 12, 2015 3:59 PM

All replies

  • User-821857111 posted

    Is your site a PHP Site?

    Thursday, April 9, 2015 3:59 AM
  • User-1078840699 posted

    Hello,

    Change your web.config file to include

    providerName="System.Data.SqlClient"

    as an attribute on the connection string like this and also do check this link

      <connectionStrings>
          <add name="ConnString" connectionString="Data Source=IP_OF_SERVER,PORT; Initial Catalog=DATABASE_NAME; UID=USERNAME; pwd=PASSWORD; Integrated Security=True;" providerName="System.Data.SqlClient" />
      </connectionStrings>


    Another Example:

    <connectionStrings>
    <clear/>
    <add name="LocalSqlServer" connectionString="Data Source=remotehost;Initial Catalog=remoteDB;User Id=username;Password=password" providerName="System.Data.SqlClient" />
    </connectionStrings>
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, April 12, 2015 3:59 PM