Καλώς ορίσατε στο dotNETZone.gr - Σύνδεση | Εγγραφή | Βοήθεια
σε

 

Αρχική σελίδα Ιστολόγια Συζητήσεις Εκθέσεις Φωτογραφιών Αρχειοθήκες

Help:Πρόβλημα ASP.NET και SQL Server2005

Îåêßíçóå áðü ôï ìÝëïò ThomasG. Τελευταία δημοσίευση από το μέλος manosB στις 03-03-2009, 19:08. Υπάρχουν 2 απαντήσεις.
Ταξινόμηση Δημοσιεύσεων: Προηγούμενο Επόμενο
  •  02-03-2009, 12:16 48808

    Help:Πρόβλημα ASP.NET και SQL Server2005

    Προσπαθώ να συνδέσω σε ένα site ASP.NET με sql και μου βγάζει προβλημα. Το site είναι ανεβασμένο στον provider, οι οποίοι μου έχουν δώσει την ip του sql server αλλά μου βγάζει συνεχώς το ίδιο πρόβλημα.Με management studio και VPN μπορώ να συνδεθώ αλλα με την IP μου βγάζει συνεχώς το ίδιο πρόβλημα.

    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 - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.) body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px} b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px} H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red } H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon } pre {font-family:"Lucida Console";font-size: .9em} .marker {font-weight: bold; color: black;text-decoration: none;} .version {color: gray;} .error {margin-bottom: 10px;} .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }

    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 - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.)

    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 - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.)

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [SqlException (0x80131904): 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 - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.)]
       System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +428
       System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +65
       System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +117
       System.Data.SqlClient.SqlConnection.Open() +122
       System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState) +31
       System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +112
       System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +287
       System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +92
       System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1297
       System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +19
       System.Web.UI.WebControls.DataBoundControl.PerformSelect() +142
       System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73
       System.Web.UI.WebControls.GridView.DataBind() +4
       System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
       System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +72
       System.Web.UI.Control.EnsureChildControls() +87
       System.Web.UI.Control.PreRenderRecursiveInternal() +44
       System.Web.UI.Control.PreRenderRecursiveInternal() +171
       System.Web.UI.Control.PreRenderRecursiveInternal() +171
       System.Web.UI.Control.PreRenderRecursiveInternal() +171
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842 
    

    Το web config που έχω είναι:

    <connectionStrings>
            <remove name="LocalSqlServer"/>
            <!--<add name="LocalSqlServer" connectionString="Data Source=.\SQLexpress;AttachDbFilename=|DataDirectory|\acheloos.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>-->
            <add name="LocalSqlServer" connectionString="Data Source=ΧΧ.Χ.Χ.ΧΧΧ,1433;Network Library=DBMSSOCN;Initial Catalog=acheloos;User ID=username;Password=password;" providerName="System.Data.SqlClient"/>
        </connectionStrings>
     

    ThomasG
  •  02-03-2009, 15:12 48809 σε απάντηση της 48808

    Απ: Help:Πρόβλημα ASP.NET και SQL Server2005

    γενικότερα σε αυτό το Blog έχει πολλά Posts για sql server protocol troubleshooting και connctivity issues.

    Για δες εδώ

    http://blogs.msdn.com/sql_protocols/archive/2005/10/22/sql-server-2005-connectivity-issue-troubleshoot-part-i.aspx
    Νικόλαος Καντζέλης
    BSc, MSc, MCAS, MCPD, MCITP, MCTS,MCP, MCT
    http://www.nksolutions.gr
    http://dotnetstories.wordpress.com
    http://weblogs.asp.net/dotnetstories
    http://forum.dotnetnuke.gr
  •  03-03-2009, 19:08 48845 σε απάντηση της 48808

    Απ: Help:Πρόβλημα ASP.NET και SQL Server2005

    ThomasG:
    Το web config που έχω είναι:

    <connectionStrings>
            <remove name="LocalSqlServer"/>
            <!--<add name="LocalSqlServer" connectionString="Data Source=.\SQLexpress;AttachDbFilename=|DataDirectory|\acheloos.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>-->
            <add name="LocalSqlServer" connectionString="Data Source=ΧΧ.Χ.Χ.ΧΧΧ,1433;Network Library=DBMSSOCN;Initial Catalog=acheloos;User ID=username;Password=password;" providerName="System.Data.SqlClient"/>
        </connectionStrings>
     
    Μπορεί το πρόβλημα σου να είναι ότι η Port του Remote SQL Server είναι διαφορετική από 1433. (Είναι στο 99% των περιπτώσεων) Το τσέκαρες?
    Manos
Προβολή Τροφοδοσίας RSS με μορφή XML
Με χρήση του Community Server (Commercial Edition), από την Telligent Systems