sql connection Error

Discussion in 'Databases' started by Recency, Jan 24, 2010.

  1. Hello
    I am having a problem by getting the error of the following:

    A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

    I cannot connect to the sql. In other words, the login and registration does not work
    This is what I have in my web config of the following:

    <connectionStrings>
    <remove name="LocalSqlServer"/>
    <add name="LocalSqlServer" connectionString="data source=.;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspn etdb.mdf;User Instance=true" providerName="System.Data.SqlClient" />

    </connectionStrings >

    Can anyone tell me what is wrong?

    This is the website that I am building:
    http://www.homemadeartdrawings.com
     
  2. Ray

    Ray

    Try replacing the connection string with this example.

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

    make sure you replace the appropriate values with what is on your account.
     

Share This Page