帮帮忙,不知哪里错了...
绑定datalist:
protected void Page_Load(object sender, EventArgs e)
    {
       string bookclassid= Request.QueryString["BookClassId"].ToString();
       string seastr = "select * from Book where BookClassId=" + bookclassid;
       Database db = new Database();
       DataSet ds = db.GetDataSet(seastr);
       DataList1.DataSource = ds;
       DataList1.DataBind();
    }datalist在源码里的代码:
  <asp:DataList ID="DataList1" runat="server" RepeatColumns="3" Width="620px">
                           <ItemTemplate>
                               <div style="text-align: center">
                                   <table style="width: 180px">
                                       <tr>
                                           <td rowspan="3" style="width: 90px">
                                               <asp:ImageButton ID="ImageButton1" runat="server"    ImageUrl='<%# Eval("PictureUrl") %>' /></td>
                                           <td style="width: 100px">
                                               <asp:Label ID="Label1" runat="server" Text='<%# Eval("BookClassName") %>' Width="60px"></asp:Label>
                                           </td>
                                       </tr>
                                       <tr>
                                           <td style="width: 100px">
                                               价格:<asp:Label ID="Label2" runat="server" Text='<%# Eval("Price") %>' Width="60px"></asp:Label></td>
                                       </tr>
                                       <tr>
                                           <td style="width: 100px">
                                               折扣价:<asp:Label ID="Label3" runat="server" Text='<%# Eval("DisPrice") %>' Width="1px"></asp:Label></td>
                                       </tr>
                                       <tr>
                                           <td colspan="2">
                                               <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="#" Width="90px">详细信息</asp:HyperLink></td>
                                       </tr>
                                   </table>
                               </div>
                           </ItemTemplate>
                       </asp:DataList>

解决方案 »

  1.   

    Book表里有BookClassName这个字段吗?
      

  2.   

    Book表里有BookClassName这个字段
      

  3.   

    除了这个原因,还有没有其他原因啊?我的Book表里有BookName这个字段的
      

  4.   

    找到原因是了,是我把BookName写成BookClassName了,各位说的对,Book表里有BookName这个字段没有BookClassName这个字段,是我写错了,呵呵....谢谢各位啦.
      

  5.   

    找到原因是了,是我把BookName写成BookClassName了,各位说的对,Book表里有BookName这个字段没有BookClassName这个字段,是我写错了,呵呵....谢谢各位啦.