ASP.net无法访问域外数据库
我使用 ASP.net 2.0、IIS 5.1 和 SQL Server 2000 构建了一个网站。
从本地主机和与服务器相同的域访问该网站工作正常。
从外部域访问网站时,将允许我仅访问 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)
问候,
I have built a website using ASP.net 2.0, IIS 5.1 and SQL server 2000.
Accessing the website from the localhost and the same domain as the server is working correctly.
While accessing the website from an outside domain, will allow me to only access the ASP.net code, whenever there is a database access an error is generated.
Please let me know how to solve this issue.
Error:
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)
Regards,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事实证明问题与SQL服务器无关,我正在调用DNS服务器来请求外部IP的机器名称。
这产生了一个错误。
我所要做的就是删除它并仅存储 IP 地址。
我想知道是否可以通过ASP.net访问客户端PC的主机名。
It turns out the problem is not related to SQL server, I was calling the DNS server to request the machine name of an outside IP.
This produced an error.
All I had to do is remove that and store the IP address only.
I wonder if the host name of the client PC can be accessed through ASP.net .