2011-10-14 28 views
3

我的網站是在舊主機工作完美無瑕,但現在我搬到了一個新主機的連接已成功與服務器建立的,但後來發生了錯誤 - provider:TCP提供程序,error:0

請注意:舊主機VPS同一主機

所以我停止支付他和現在我主機上相同的主機作爲共享主機

所以我感動了所有的文件到根文件夾,並在Web.config文件

我不能加載網站由於某種原因,配置的SQL細節。 我總是得到錯誤。 請幫助我!

後,我固定我的Ajax問題。這裏 - >Could not load file or assembly 'System.Web.Extensions, Version=1.0.61025.0 Error

我遇到了另一個問題..

這是我的SQL Server詳細信息:

Server name : WEBSQL2K5

Server version : Microsoft SQL Server 2005 - 9.00.4035.00 (Intel X86)

Standard Edition on Windows NT 5.2 (Build 3790: Service Pack 2)

myLittleAdmin (for SQL Server and MSDE) v.2.7 r.118

這是連接字符串

<connectionStrings> 
     <add name="Con" connectionString="Data Source=localhost;Initial Catalog=DBname;user=DBusr;password=DBpass;" providerName="System.Data.SqlClient"/> 
    </connectionStrings> 

'/'應用程序中的服務器錯誤。

A connection was successfully established with the server, but then an 
error occurred during the login process. (provider: TCP Provider, 
error: 0 - The specified network name is no longer available.) 

描述: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.

異常詳細信息:System.Data.SqlClient.SqlException: A connection was successfully established with the server, but then an error occurred during the login process. (provider: TCP Provider, error: 0 - The specified network name is no longer available.)

源錯誤:

Line 25032:   this.Adapter.SelectCommand.Parameters[0].Value = ((int)(id)); 
Line 25033:   main_ds.TXTDataTable dataTable = new main_ds.TXTDataTable(); 
Line 25034:   this.Adapter.Fill(dataTable); 
Line 25035:   return dataTable; 
Line 25036:  } 

源文件:c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\cf53bee4\ce0ba883\App_Code.vago_96o.15.cs Line: 25034

堆棧跟蹤:

[SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the login process. (provider: TCP Provider, error: 0 - The specified network name is no longer available.)] 
    System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4846887 
    System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194 
    System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObject stateObj, UInt32 error) +527 
    System.Data.SqlClient.TdsParserStateObject.ReadSni(DbAsyncResult asyncResult, TdsParserStateObject stateObj) +359 
    System.Data.SqlClient.TdsParserStateObject.ReadNetworkPacket() +88 
    System.Data.SqlClient.TdsParserStateObject.ReadBuffer() +39 
    System.Data.SqlClient.TdsParserStateObject.ReadByte() +20 
    System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +107 
    System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +35 
    System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +144 
    System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +342 
    System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +221 
    System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +189 
    System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +185 
    System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +31 
    System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +433 
    System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66 
    System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +499 
    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(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) +162 
    System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) +115 
    main_dsTableAdapters.TXTTableAdapter.GetDataByID(Int32 id) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\cf53bee4\ce0ba883\App_Code.vago_96o.15.cs:25034 
    _Default.InitSeo() in \\filer\sites\NV355601\www.picit.co.il\www\default.aspx.cs:36 
    _Default.Page_Load(Object sender, EventArgs e) in \\filer\sites\NV355601\www.picit.co.il\www\default.aspx.cs:28 
    System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14 
    System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35 
    System.Web.UI.Control.OnLoad(EventArgs e) +99 
    System.Web.UI.Control.LoadRecursive() +50 
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627 

網絡。配置:

<?xml version="1.0"?> 
<configuration> 
    <appSettings> 
     <add key="SiteAddress" value="http://www.picit.co.il/" /> 
     <add key="SSLSiteAddress" value="https://bonsite-secure.co.il/picit/" /> 

     <add key="EMAIL_HOST" value="mail.barak.net.il"/> 
     <add key="EMAIL_CONTACT_NAME" value="PicIt"/> 
     <add key="EMAIL_USER" value="bonsite-barak.net.il"/> 
     <add key="EMAIL_PASS" value="013013"/> 
     <add key="MASTER_USERNAME" value="bonsite"/> 
     <add key="MASTER_PASSWORD" value="master123#"/> 

     <add key="FCKeditor:UserFilesPath" value="~/Up/Main/"/> 
     <add key="FCKeditor:BasePath" value="~/Controls/FCKeditor/"/> 
    </appSettings> 
    <connectionStrings> 
     <add name="Con" connectionString="Data Source=localhost;Initial Catalog=DBname;user=DBusr;password=DBpass;" providerName="System.Data.SqlClient"/> 
    </connectionStrings> 
    <system.web> 
     <globalization culture="he-IL" uiCulture="he-IL"/> 
     <sessionState mode="InProc"/> 
     <customErrors mode="Off"/> 
     <identity impersonate="true"/> 
     <authentication mode="Windows"/> 
     <httpRuntime maxRequestLength="22000" 
minFreeThreads="16" 
executionTimeout="500" 
useFullyQualifiedRedirectUrl="false" 
minLocalRequestFreeThreads="4" 
appRequestQueueLimit="1000" /> 
     <pages theme="Front"> 
      <namespaces> 
       <add namespace="Website"/> 
      </namespaces> 
      <controls> 
       <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" namespace="System.Web.UI" tagPrefix="asp"/> 
       <add tagPrefix="Upload" namespace="Brettle.Web.NeatUpload" assembly="Brettle.Web.NeatUpload"/> 
       <add tagPrefix="fck" namespace="FredCK.FCKeditorV2" assembly="FredCK.FCKeditorV2"/> 
       <add tagPrefix="swf" tagName="movie" src="~/Controls/swf.ascx"/> 
       <add tagPrefix="Btn" tagName="Friend" src="~/Controls/btn_friend.ascx"/> 
       <add assembly="Bound" namespace="CustomControls" tagPrefix="asp"/> 
       <add assembly="skmValidators" namespace="skmValidators" tagPrefix="Vld"/> 

       <add tagPrefix="CC" tagName="Upload" src="~/Controls/upload.ascx"/> 
      </controls> 
     </pages> 
     <compilation debug="true"> 
      <assemblies> 
       <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> 
       <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
      </assemblies> 
     </compilation> 
     <httpModules> 
      <add name="UploadHttpModule" type="Brettle.Web.NeatUpload.UploadHttpModule, Brettle.Web.NeatUpload"/> 
      <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> 
     </httpModules> 
     <httpHandlers> 
      <remove verb="*" path="*.asmx"/> 
      <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> 
      <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/> 
      <add verb="GET" path="ScriptResource.axd" type="Microsoft.Web.Handlers.ScriptResourceHandler" validate="false"/> 
     </httpHandlers> 
    </system.web> 
    <system.webServer> 
     <modules> 
      <add name="UploadHttpModule" type="Brettle.Web.NeatUpload.UploadHttpModule, Brettle.Web.NeatUpload" preCondition="managedHandler"/> 
      <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="managedHandler"/> 
     </modules> 
     <handlers> 
      <add name="ScriptResource.axd_GET" path="ScriptResource.axd" verb="GET" type="Microsoft.Web.Handlers.ScriptResourceHandler" preCondition="integratedMode,runtimeVersionv2.0"/> 
      <add name="ScriptResource.axd_GET,HEAD" path="ScriptResource.axd" verb="GET,HEAD" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="integratedMode,runtimeVersionv2.0"/> 
      <add name="*.asmx_*" path="*.asmx" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="integratedMode,runtimeVersionv2.0"/> 
     </handlers> 
     <validation validateIntegratedModeConfiguration="false"/> 
    </system.webServer> 
</configuration> 
+0

它報告一個無效的網絡名稱,但我沒有看到它將在哪裏指定。它是否在另一個缺失的配置文件中設置? (是'localhost'嗎?似乎不太可能,但你永遠不知道,你的主機上的'localhost'是否正確解析?) – sarnold

+0

嗯..我不認爲有另一個配置文件。它是一個共享主機..即使我將其更改爲127.0.0.1它仍然顯示我相同的錯誤 – Ofear

回答

1

同樣你要問你的供應商與usernamepassword創建MS-SQL database或者您可以通過控制面板中創建它。

+0

他們已經這樣做。我有DBname和數據庫usr和密碼。並將所有SQL表設置爲 – Ofear

+1

@Ofear - 然後使用當前數據庫server.set DataSet = WEBSQL2K5構建連接字符串的更多信息,請訪問:http://www.connectionstrings.com/ – adatapost

+1

您的知識是驚人的!!這樣可行!非常感謝你!! – Ofear

1

我有這個問題。

發生這是因爲數據庫服務器已被賦予第二個IP地址。在客戶端,這個名字可以解決哪個地址非常有用,而且我正在獲得新的地址。

刪除第二個IP地址解決了問題。

我懷疑SQL服務器正在監聽原始地址,但不在附加的地址上。

+0

這聽起來是我所擁有的,因爲我一直都沒有看到這個錯誤。您是否從SQL Server網絡配置中刪除IP地址? – H20rider

1

我知道這已經回答了,這些解決方案可能也有效,但我遇到了這個問題,經過幾個小時的嘗試從網絡上提出不同的建議 - 一件事情奏效了。

  • 重置我的Web應用程序使用的IIS應用程序池。

有時回到基礎幫助!

1

在我的情況下,「TCP提供程序,錯誤:0 - 指定的網絡名稱不再可用。」錯誤是由網絡安全設備造成的。一旦源自此服務器的數據庫連接被排除在安全監控之外,則此問題已解決。

0

我想補充一點,如果您的系統使用的是* .ini文件,您可能想要檢查那裏輸入的服務器名稱,並確保它與web.config連接字符串中的內容相同。

0

我也有類似的問題,但不完全一樣:

System.Data.SqlClient.SqlException (0x80131904): A connection was successfully established enter code here with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - The specified data could not be decrypted.) 

我跟着@Password在重新啓動應用程序池,但後來看了高級設置,看到「啓用32位應用程序」被設置爲假。我改變了這個是真的,我的問題解決了。希望這可以幫助那些嘗試過所有其他建議並打破僵局的人。

相關問題