none
Server Error in '/' Application.本地计算机测试无错误,上传到远程服务器虚拟主机产生错误,http://freeaspnet.7host.com RRS feed

答案

  • webconfig写错了,重新用软件处理一下就对了。

    <?xml version="1.0"?>
    <!-- 
        注意: 除了手动编辑此文件外,您还可以使用 
        Web 管理工具来配置应用程序的设置。可以使用 Visual Studio 中的
        “网站”->“Asp.Net 配置”选项。
        设置和注释的完整列表可以在
        machine.config.comments 中找到,该文件通常位于
          \Windows\Microsoft.Net\Framework\vx.x\Config 中 
    -->
    <configuration>
    	<appSettings/>
    	<connectionStrings/>
    	<system.web>
    		<!--
                设置 compilation debug="true" 可将调试符号
                插入已编译的页面中。
                但由于这会影响性能,因此请仅在开发过程中将此值
                设置为 true。
            -->
    		<compilation debug="false">
    			<assemblies>
    				<add assembly="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    				<add assembly="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    				<add assembly="System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    				<add assembly="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    				<add assembly="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    				<add assembly="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    				<add assembly="System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    				<add assembly="System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    				<add assembly="System.DirectoryServices.Protocols, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    				<add assembly="System.EnterpriseServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    				<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    				<add assembly="System.ServiceProcess, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    				<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    				<add assembly="System.Web.RegularExpressions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies></compilation>
    		<!--
              通过 <authentication> 节可以配置
              安全身份验证模式,ASP.NET 
              使用该模式来识别来访用户身份。 
            
    		<authentication mode="Windows"/>-->
    		<!--
               如果在执行请求的过程中出现未处理的错误,
               则通过 <customErrors> 节
               可以配置相应的处理步骤。具体而言,
               开发人员通过该节可配置要显示的 html 错误页,
               以代替错误堆栈跟踪。
      -->
               <customErrors mode="on" >
                 <error statusCode="403" redirect="NoAccess.htm" />
                 <error statusCode="404" redirect="FileNotFound.htm" />
               </customErrors>
          
    	</system.web>
    </configuration>

    
    
    
    
    
    
    
    

    http://hi.baidu.com/useek/blog

    • 已标记为答案 firedream 2013年2月3日 13:29
    2013年1月31日 9:18

全部回复

  • Imports System.Data
    Imports System.Data.OleDb
    Partial Class _Default
        Inherits System.Web.UI.Page
        Protected Sub TreeViewQuota_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles TreeViewQuota.Init
            Dim strSql As String
            strSql = "select 专业名称,书号 from  定额库索引视图 where ((分类 like '%预算定额%') and (书号 like '%2011')) order by  顺号"
            Using seekQuota(strSql, "专业名称", "书号")
                Dim recordQuota As DataTable = seekQuota(strSql, "专业名称", "书号")
                Dim row As DataRow
                For Each row In recordQuota.Rows
                    Dim QuotaNode As New TreeNode
                    QuotaNode.Text = row("专业名称")
                    QuotaNode.Value = row("书号")
                    TreeViewQuota.Nodes.Add(QuotaNode)
                Next row
            End Using
        End Sub
    
        Protected Sub TreeViewQuota_SelectedNodeChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TreeViewQuota.SelectedNodeChanged
    
            If TreeViewQuota.SelectedNode.ChildNodes.Count <= 0 Then
                'MsgBox(TreeViewQuota.SelectedNode.Depth)
                Select Case CStr((TreeViewQuota.SelectedNode.Depth + 1))
                    Case 1
                        Dim strSql As String
                        strSql = "select 节号,节名称 from  定额节索引视图 where  书号 like '%" + TreeViewQuota.SelectedNode.Value + "'and LEN(trim(节号)) = " + CStr((TreeViewQuota.SelectedNode.Depth + 1) * 2)
                        Using seekQuota(strSql, "节号", "节名称")
                            Dim recordQuota As DataTable = seekQuota(strSql, "节号", "节名称")
                            Dim row As DataRow
                            For Each row In recordQuota.Rows
                                Dim QuotaNode As New TreeNode
                                QuotaNode.Text = row("节名称")
                                QuotaNode.Value = row("节号")
                                TreeViewQuota.SelectedNode.ChildNodes.Add(QuotaNode)
                            Next row
                        End Using
                    Case Is >= 2
                        'MsgBox(Split(TreeViewQuota.SelectedNode.ValuePath, "/")(0).ToString())
                        Dim strSql As String
                        strSql = "select 节号,节名称 from  定额节索引视图 where  节号 like '" + TreeViewQuota.SelectedNode.Value + "%'and LEN(trim(节号)) = " + CStr((TreeViewQuota.SelectedNode.Depth + 1) * 2) + "and 书号 like '%" + Split(TreeViewQuota.SelectedNode.ValuePath, "/")(0).ToString + "%'"
                        Using seekQuota(strSql, "节号", "节名称")
                            Dim recordQuota As DataTable = seekQuota(strSql, "节号", "节名称")
                            Dim row As DataRow
                            For Each row In recordQuota.Rows
                                Dim QuotaNode As New TreeNode
                                QuotaNode.Text = row("节名称")
                                QuotaNode.Value = row("节号")
                                TreeViewQuota.SelectedNode.ChildNodes.Add(QuotaNode)
                            Next row
                        End Using
                        If TreeViewQuota.SelectedNode.ChildNodes.Count = 0 Then
                            Dim strSql2 As String
                            strSql2 = "select * from  定额库视图 where  节号 like '" + TreeViewQuota.SelectedNode.Value + "' and 书号 like '%" + Split(TreeViewQuota.SelectedNode.ValuePath, "/")(0).ToString + "%' order by 定额编号"
                            Using seekQuota(strSql2, "节号", "书号")
                                Dim con As New OleDbConnection
                                Dim cs As String = " Provider=microsoft.jet.oledb.4.0;data source=" + Server.MapPath("App_Data/铁路定额2011版数据整理.mdb").ToString()
                                con.ConnectionString = cs
                                con.Open()
                                Dim cmdQuota As New OleDbCommand(strSql2, con)
                                Dim readQuotaAdapter As New OleDbDataAdapter
                                readQuotaAdapter.SelectCommand = cmdQuota
                                Dim QuotaTable As New DataTable
                                readQuotaAdapter.Fill(QuotaTable)
                                GridView1.DataSource = QuotaTable
                                GridView1.DataMember = "定额库视图"
                                GridView1.DataBind()
                                
                            End Using
                        End If
                End Select
            End If
        End Sub
    
        Function seekQuota(ByVal strSql As String, ByVal str1 As String, ByVal str2 As String) As DataTable
            Dim con As New OleDbConnection
            Dim cs As String = " Provider=microsoft.jet.oledb.4.0;data source=" + Server.MapPath("App_Data/铁路定额2011版数据整理.mdb").ToString()
            con.ConnectionString = cs
            Dim readQuotaAdapter As OleDbDataAdapter = New OleDbDataAdapter(strSql, con)
            Dim QuotaTable As DataTable = New DataTable
            readQuotaAdapter.Fill(QuotaTable)
            Return QuotaTable
    
        End Function
    
        Function goRootNode(ByVal inputNode As TreeNode) As TreeNode
            Dim outNode As New TreeNode
    
            outNode = inputNode.Parent
            
            Return outNode
        End Function
    
    End Class
    


    http://hi.baidu.com/useek/blog

    2013年1月30日 7:12
  • <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
                <asp:TreeView ID="TreeViewQuota" runat="server" Width="255px" 
                    AutoGenerateDataBindings="False" BorderStyle="Ridge" BorderWidth="2px" 
                    ShowLines="True">
            </asp:TreeView>
             
                <asp:GridView ID="GridView1" runat="server" style="margin-top: 0px">
                </asp:GridView>
                 </div>
           </form>
    </body>
    </html>
    


    http://hi.baidu.com/useek/blog

    2013年1月30日 7:13
  • Errore server nell'applicazione '/'.
    --------------------------------------------------------------------------------
    
    Eccezione di protezione 
    Descrizione: L'applicazione ha tentato di eseguire un'operazione non consentita dai criteri di protezione. Per attribuire all'applicazione le autorizzazioni necessarie, contattare l'amministratore del sistema oppure modificare il livello di attendibilità dell'applicazione nel file di configurazione. 
    
    Dettagli eccezione: System.Security.SecurityException: Richiesta di autorizzazione di tipo 'System.Data.OleDb.OleDbPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' non soddisfatta.
    
    Errore nel codice sorgente: 
    
    
    Riga 103:        Dim readQuotaAdapter As OleDbDataAdapter = New OleDbDataAdapter(strSql, con)
    Riga 104:        Dim QuotaTable As DataTable = New DataTable
    Riga 105:        readQuotaAdapter.Fill(QuotaTable)
    Riga 106:        Return QuotaTable
    Riga 107:
     
    
    File di origine: D:\AspNet1\firebug\Default.aspx.vb    Riga: 105 
    


    http://hi.baidu.com/useek/blog

    2013年1月30日 7:18
  • webconfig写错了,重新用软件处理一下就对了。

    <?xml version="1.0"?>
    <!-- 
        注意: 除了手动编辑此文件外,您还可以使用 
        Web 管理工具来配置应用程序的设置。可以使用 Visual Studio 中的
        “网站”->“Asp.Net 配置”选项。
        设置和注释的完整列表可以在
        machine.config.comments 中找到,该文件通常位于
          \Windows\Microsoft.Net\Framework\vx.x\Config 中 
    -->
    <configuration>
    	<appSettings/>
    	<connectionStrings/>
    	<system.web>
    		<!--
                设置 compilation debug="true" 可将调试符号
                插入已编译的页面中。
                但由于这会影响性能,因此请仅在开发过程中将此值
                设置为 true。
            -->
    		<compilation debug="false">
    			<assemblies>
    				<add assembly="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    				<add assembly="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    				<add assembly="System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    				<add assembly="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    				<add assembly="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    				<add assembly="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    				<add assembly="System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    				<add assembly="System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    				<add assembly="System.DirectoryServices.Protocols, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    				<add assembly="System.EnterpriseServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    				<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    				<add assembly="System.ServiceProcess, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    				<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    				<add assembly="System.Web.RegularExpressions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies></compilation>
    		<!--
              通过 <authentication> 节可以配置
              安全身份验证模式,ASP.NET 
              使用该模式来识别来访用户身份。 
            
    		<authentication mode="Windows"/>-->
    		<!--
               如果在执行请求的过程中出现未处理的错误,
               则通过 <customErrors> 节
               可以配置相应的处理步骤。具体而言,
               开发人员通过该节可配置要显示的 html 错误页,
               以代替错误堆栈跟踪。
      -->
               <customErrors mode="on" >
                 <error statusCode="403" redirect="NoAccess.htm" />
                 <error statusCode="404" redirect="FileNotFound.htm" />
               </customErrors>
          
    	</system.web>
    </configuration>

    
    
    
    
    
    
    
    

    http://hi.baidu.com/useek/blog

    • 已标记为答案 firedream 2013年2月3日 13:29
    2013年1月31日 9:18