locked
Server Error in '/' Application. RRS feed

  • Question

  • Hi,

    I am getting this error on my website, please help me.

    I am sharing my connection string:---------

    <appSettings>
        <!--    <add key="StrCon" value="Data Source=tcp:esql2k501.discountasp.net;Initial Catalog=SQL2005_537384_dominiondb;User ID=SQL2005_537384_dominiondb_user;"/>-->
          <add key="StrCon" value="Data Source=tcp:esql2k501.discountasp.net;Initial Catalog=SQL2005_537384_dominiondb;User ID=SQL2005_537384_dominiondb_user;"/>

      </appSettings>

    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: TCP Provider, error: 0 - No such host is known.)

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Data.SqlClient.SqlException: 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: TCP Provider, error: 0 - No such host is known.)

    Source Error:

    Line 23:         cmd.CommandText = "Select ContentDetails from TblHome";
    Line 24: cmd.Connection = TuCon;
    Line 25: cmd.Connection.Open();
    Line 26: SqlDataReader rdr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
    Line 27: while (rdr.Read())
    Friday, September 11, 2009 10:42 AM

Answers

  • The sql error in your post does mean that "The SQL Server client cannot connect to the server. The error could occur because either the client cannot resolve the name of the server or the name of the server is incorrect."

    The possbile thing that you should do to overcome this is,
    Make sure that you have entered the correct server name on the client, and that you can resolve the name of the server from the client.
    To check TCP/IP name resolution, you can use the ping command in the Windows operating system.
    Thanks, Leks
    Sunday, September 13, 2009 10:49 PM