private void Page_Load(object sender, System.EventArgs e)
        {            if (Session["jb"].ToString() == "0")
            {
            }
            else
            {
                Response.Write("您不是合法用户,请登入后再操作!");
                Response.Redirect("Error.aspx");
                Page.Response.End();
            } 
            
            DateTime dt = DateTime.Now;
            end.Text = dt.ToString();
            if (!IsPostBack) BindGrid();
        }        private void BindGrid()
        {
            String strConnection = ConfigurationSettings.AppSettings["ConnectionString"];            SqlConnection myConnection = new SqlConnection(strConnection);
            SqlDataAdapter da = new SqlDataAdapter("select * from classdata11 order by ID desc", myConnection);
            DataSet ds = new DataSet();
            da.Fill(ds);
            DataGrid1.DataSource = ds;
            DataGrid1.DataBind();        }

解决方案 »

  1.   

    确保 classdata11 内有 id 字段
      

  2.   

    <tr>
    <td width="91" style="HEIGHT: 30px"><asp:Label ID="Label1" runat="server">查询一</asp:Label></td>
    <td style="HEIGHT: 30px">&nbsp;
    <asp:DropDownList id="wentilist" runat="server" OnSelectedIndexChanged="wentilist_SelectedIndexChanged1">
    <asp:ListItem Value="硬件问题">硬件问题</asp:ListItem>
    <asp:ListItem Value="网络问题">网络问题</asp:ListItem>
    <asp:ListItem Value="邮件问题">邮件问题</asp:ListItem>
                                <asp:ListItem>其它问题</asp:ListItem>
                                <asp:ListItem>系统问题</asp:ListItem>
    </asp:DropDownList>
    <asp:Label id="Label2" runat="server" Width="64px">起始时间</asp:Label>
    <asp:TextBox id="begin" runat="server"></asp:TextBox>
    <asp:Label id="Label3" runat="server">结束时间</asp:Label>
    <asp:TextBox id="end" runat="server"></asp:TextBox>
    <asp:Button id="Button1" runat="server" Text="查找" OnClick="Button1_Click1"></asp:Button></td>
    </tr>
      

  3.   

    不是没人管,而是在你贴出的aspx内容中哪有DataGrid1的内容
      

  4.   

    Click the link to solve your problem.Good luck!