gridview 如果不使用向导怎么绑定数据啊

解决方案 »

  1.   

    this.DataView1.DataSrouce=  dt.Default.View ;//dt是一个table
    this.DataView1.DataBind();-----难免有错,错了莫怪.
      

  2.   

    gridview.DataSource = dataset;
    gridview.DataBind();
      

  3.   

    gridview 用向导绑定数据后,想实现一个查询的功能,怎么做呢?? 以下是查询的HTML <asp:Label ID="Label1" runat="server" Text="姓名"></asp:Label>
                    <asp:TextBox ID="tb1" runat="server"></asp:TextBox>
                    <asp:DropDownList ID="dp2" runat="server">
                        <asp:ListItem>全部</asp:ListItem>
                        <asp:ListItem>a问题</asp:ListItem>
                        <asp:ListItem>b问题</asp:ListItem>
                        <asp:ListItem>c问题</asp:ListItem>
                        <asp:ListItem>d问题</asp:ListItem>
                        <asp:ListItem>e问题</asp:ListItem>
                    </asp:DropDownList>
                    <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="查询" /
      

  4.   

    dp2.datasource=dataset
    dp2.datatextfield="id"
    dp2.datavaluefield="user"
    dp2.DataBind()