ASP.net无法访问域外的数据库

时间:2011-03-30 12:43:49

标签: database dns asp.net-2.0 iis-5

我使用ASP.net 2.0,IIS 5.1和SQL server 2000构建了一个网站。

从localhost访问网站,并且服务器与域名相同。

从外部域访问网站时,只允许我访问ASP.net代码,只要有数据库访问就会生成错误。

请让我知道如何解决这个问题。

错误:

Event code: 3005 
Event message: An unhandled exception has occurred. 
Event time: 3/30/2011 4:54:28 PM 
Event time (UTC): 3/30/2011 1:54:28 PM 
Event ID: 44111a894d594247ad5e92e934d56c01 
Event sequence: 6 
Event occurrence: 1 
Event detail code: 0 

Application information: 
    Application domain: /LM/W3SVC/1/Root/SurveySite-12-129459668610468750 
    Trust level: Full 
    Application Virtual Path: /SurveySite 
    Application Path: c:\inetpub\wwwroot\Survey\ 
    Machine name: MIND****** 

Process information: 
    Process ID: 560 
    Process name: w3wp.exe 
    Account name: NT AUTHORITY\NETWORK SERVICE 

Exception information: 
    Exception type: SocketException 
    Exception message: No such host is known 

Request information: 
    Request URL: http://10.7.1.20/surveysite/Default.aspx 
    Request path: /surveysite/Default.aspx 
    User host address: 10.1.1.65 
    User:  
    Is authenticated: False 
    Authentication Type:  
    Thread account name: NT AUTHORITY\NETWORK SERVICE 

Thread information: 
    Thread ID: 12 
    Thread account name: NT AUTHORITY\NETWORK SERVICE 
    Is impersonating: False 
    Stack trace:    at System.Net.Dns.GetAddrInfo(String name)
   at System.Net.Dns.InternalGetHostByAddress(IPAddress address, Boolean includeIPv6, Boolean throwOnFailure)
   at System.Net.Dns.GetHostEntry(String hostNameOrAddress)
   at _Default.btnStart_Click(Object sender, EventArgs e) in c:\Inetpub\wwwroot\SurveySite\Default.aspx.cs:line 21
   at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
   at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
   at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
   at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
   at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

问候,

1 个答案:

答案 0 :(得分:0)

事实证明问题与SQL服务器无关,我正在调用DNS服务器来请求外部IP的机器名。

这产生了错误。

我所要做的就是删除它并仅存储IP地址。

我想知道客户端PC的主机名是否可以通过ASP.net访问。