使用虚拟空间,建立Asp.net的网页,原来好好的,突然出现无法访问数据库的问题,提示下面的信息,同管理员共同研究,查阅国外是否有好的解决办法,弄了一天一头雾水。
远程数据库使用本地的企业管理器,和本地建立网页(本地就是作者家里),均可以正常访问网站提供的远程数据库,而虚拟空间上的Asp和Asp.net网页均出现无法访问数据库的问题,Asp网页提示无法连接,Asp.net网页提示下面的信息。说明问题出在虚拟空间上,经过管理员更换空间后恢复正常。问题可能原因:数据库所在服务器防火墙拒绝了该虚拟空间IP的访问;虚拟空间防火墙阻挡了数据库访问出站;虚拟空间中关于数据库访问的组件出现问题。
A connection was successfully established with the server, but then an error occurred during the login process. (provider: TCP Provider, error: 0 - 指定的网络名不再可用。)
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 connection was successfully established with the server, but then an error occurred during the login process. (provider: TCP Provider, error: 0 - 指定的网络名不再可用。)
Source Error:
Line 14: Dim id As Integer
Line 15: id = 1
Line 16: conpubs.Open()
Line 17: zhongzi = New Random '获得记录总数以便进行随机种子计算
Line 18: selectYuJu = "select count(*) from joke"
Source File: D:\hosting\wwwroot\aaazhongu_com\htdocs\humour_index.aspx.vb Line: 16
Stack Trace:
[SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the login process. (provider: TCP Provider, error: 0 - 指定的网络名不再可用。)]
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +735091
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188
System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObject stateObj, UInt32 error) +556
System.Data.SqlClient.TdsParserStateObject.ReadSni(DbAsyncResult asyncResult, TdsParserStateObject stateObj) +164
System.Data.SqlClient.TdsParserStateObject.ReadPacket(Int32 bytesExpected) +34
System.Data.SqlClient.TdsParserStateObject.ReadBuffer() +30
System.Data.SqlClient.TdsParserStateObject.ReadByte() +17
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +59
System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +33
System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +628
System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +170
System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +359
System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28
System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +424
System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66
System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +496
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105
System.Data.SqlClient.SqlConnection.Open() +111
humour_index.Page_Load(Object sender, EventArgs e) in D:\hosting\wwwroot\zhongguosou_com\htdocs\humour_index.aspx.vb:16
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061