<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:universityConnectionString %>" 
            DeleteCommand="DELETE FROM student WHERE (stno = @stno)" 
            InsertCommand="INSERT INTO student(fname, lname, average, stno, sex, course) VALUES (@fname, @lname, @average, @stno, @sex, @course)" 
            SelectCommand="SELECT * FROM [student]" 
            UpdateCommand="UPDATE student SET fname = @fname, lname = @lname, average = @average, sex = @sex, course = @course WHERE (stno = @stno)">
        </asp:SqlDataSource>
        <asp:DetailsView ID="DetailsView1" runat="server" AllowPaging="True" 
            AutoGenerateRows="False" DataKeyNames="stno" DataSourceID="SqlDataSource1" 
            Height="50px" Width="271px">
            <PagerSettings FirstPageText="First" LastPageText="Last" 
                Mode="NextPreviousFirstLast" NextPageText="Next" PreviousPageText="Prev" />
            <Fields>
                <asp:BoundField DataField="fname" HeaderText="fname" SortExpression="fname" />
                <asp:BoundField DataField="lname" HeaderText="lname" SortExpression="lname" />
                <asp:BoundField DataField="average" HeaderText="average" 
                    SortExpression="average" />
                <asp:BoundField DataField="stno" HeaderText="stno" SortExpression="stno" />
                <asp:CheckBoxField DataField="sex" HeaderText="sex" SortExpression="sex" />
                <asp:BoundField DataField="course" HeaderText="course" 
                    SortExpression="course" />
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" 
                    ShowInsertButton="True" />
            </Fields>
        </asp:DetailsView>
    
    </div>
    </form>
</body>
</html>
