按照这个提示去改Web.Config文件
2) Add the following section to the configuration file of your application:<configuration>
   <system.web>
       <compilation debug="true"/>
   </system.web>
</configuration>

解决方案 »

  1.   

    如果:
    <configuration>
       <system.web>
           <compilation debug="true"/>
       </system.web>
    </configuration>
      已经是的话,
    可看右击你的工程/属性/configuration properties中的Debugging中的Enable ASP.NET Debugging是否为True.
      

  2.   

    将出错时的sql语句打出来看看。
      

  3.   

    If Start.SelectedItem.Text="" or Land.SelectedItem.Text="" Then Response.Redirect("航班查询.aspx") else Sql = "Select * From hb Where 起点='"& Start.SelectedItem.Text &"' and 终点='"& Land.SelectedItem.Text &"'" End If
    单独调出来试试,可能是双引号作怪。
      

  4.   

    If Start.SelectedItem.Text="" or Land.SelectedItem.Text="" Then
    Response.Redirect("航班查询.aspx")
    else
    Sql = "Select * From hb Where 起点='"& Start.SelectedItem.Text &"' and 终点='"& Land.SelectedItem.Text &"'"
    End If既然起点和终点是必要的信息为什么不开始就给他选择一个值
       start
       land    都把北京作为默认值,这样start land 就什么情况下也会有值了。别外这样的写法不太好吧  没有必要用Response.Redirect("航班查询.aspx")If Start.SelectedItem.Text="" or Land.SelectedItem.Text="" Then
                               '或在这里写信息要求选择地点
                               return   '在c#中是 return 跳出过程不执行
    else
    Sql = "Select * From hb Where 起点='"& Start.SelectedItem.Text &"' and 终点='"& Land.SelectedItem.Text &"'"
    End If
      

  5.   

    If Start.SelectedItem.Text="" or Land.SelectedItem.Text="" Then
    改为
    If Start.SelectedItem.Length>0 or Land.SelectedItem.Text.length>0 then