把程序搬迁到另外一台服务器结果在用到数据库查询的时候报错Server Error in '/aspx' Application.
--------------------------------------------------------------------------------Runtime Error 
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine. Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
<!-- Web.Config Configuration File --><configuration>
    <system.web>
        <customErrors mode="Off"/>
    </system.web>
</configuration>
 Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.
<!-- Web.Config Configuration File --><configuration>
    <system.web>
        <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
    </system.web>
</configuration>web.config
里是 <system.web>
        <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
    </system.web>是不是服务器的.NetFrameWork不一样
是不是把mode设置成off就行了 

解决方案 »

  1.   

    <system.web>
            <customErrors mode="Off" defaultRedirect="mycustompage.htm"/>
        </system.web>可以远程显示详细错误信息,根据错误信息看看.
      

  2.   

    设置成Off是不管本地还是远程访问,都显示ASP.NET的错误信息
    设置成On是不管本地还是远程访问,都不显示ASP.NET的错误信息,而是转向你设定的mycustompage.htm设置成RemoteOnly是本地访问出错时,显示ASP.NET错误信息,远程访问时显示你设定的mycustompage.htm自定义出错页面。