想编辑一个利用学号查询学生排名的界面,要将数据库中的数据绑定到datagridview中,不知道整个界面的编码怎么写?求各位大哥大姐帮忙,这可是毕设啊。小弟初学者万分感谢DataGridView数据库

解决方案 »

  1.   

     <asp:Repeater ID="rpSingle" runat="server" >
        <HeaderTemplate><strong>一、单选题</strong></HeaderTemplate>
            <ItemTemplate>
                <ul>
                    <li>
                        <%#(Container.ItemIndex+1)%>.&nbsp<asp:Label ID="lblSingleQ" runat="server" Text='<%#Eval("question") %>'></asp:Label>
                        <asp:Label
                            ID="lblQid" runat="server" Text='<%#Eval("question_id") %>' Visible="false"></asp:Label>
                    </li>
                    <li>
                        <asp:RadioButton ID="rbA" runat="server" GroupName="s1" Text='<%#Eval("a") %>' />
                    </li>
                    <li>
                        <asp:RadioButton ID="rbB" runat="server" GroupName="s1" Text='<%#Eval("b") %>' />
                        </li>
                    <li>
                        <asp:RadioButton ID="rbC" runat="server" GroupName="s1" Text='<%#Eval("c") %>' />
                    </li>
                    <li>
                        <asp:RadioButton ID="rbD" runat="server" GroupName="s1" Text='<%#Eval("d") %>' />
                    </li>
                    <br />
     
                    <li>
                        <asp:Label ID="lblSingleStuPlay" runat="server" ForeColor="Blue" Text="学生答案是:"></asp:Label><asp:Label ID="lblStuAnswer" ForeColor="Blue" runat="server" Text='<%#Eval("student_answer")%>'></asp:Label>
                       &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <asp:Label ID="lblSinglePlay" runat="server" ForeColor="Blue" Text=" 正确答案是:" ></asp:Label> <asp:Label ID="lblAnswer" ForeColor="Blue" runat="server" Text='<%#Eval("answer") %>'></asp:Label>
                    </li>
                </ul>
            </ItemTemplate>
        </asp:Repeater>
      

  2.   


    不是很明白   是否是用DGV显示学生的数据?
      

  3.   

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            学号:<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
            <asp:Button ID="Button1" runat="server" Text="查询" onclick="Button1_Click" />
        </div>
        <div>
            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False">
                <Columns>
                    <asp:BoundField DataField="id" HeaderText="学号" />
                    <asp:BoundField DataField="name" HeaderText="姓名" />
                    <asp:BoundField DataField="position" HeaderText="排名" />
                </Columns>
            </asp:GridView>
        </div>
        </form>
    </body>
    </html>
      

  4.   


    select * from Student where StuNum = ''
    group by 名次字段 desc or asc
      

  5.   

    给个简单例子,楼主看看吧
    http://www.cnblogs.com/slcfhr/archive/2006/07/20/456003.html
      

  6.   


    不是很明白   是否是用DGV显示学生的数据?
    是的
      

  7.   

    不是很难把 把数据输入到数据库里 然后做一个textbox输入学号用 点查询后从数据库里读取数据 存到datagrid里不就行了