<%@ 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:BlogConnectionString %>" 
            DeleteCommand="DELETE FROM [Articles] WHERE [ArticleID] = @ArticleID" 
            InsertCommand="INSERT INTO [Articles] ([Title], [A_Content], [PublishedTime], 
                          [Tag_ID],[Dec], [ViewNum]) VALUES (@Title, @A_Content, 
                          @PublishedTime, @Tag_ID, @Dec, @ViewNum)" 
            SelectCommand="SELECT * FROM [Articles]" 
            UpdateCommand="UPDATE [Articles] SET [Title] = @Title, [A_Content] = @A_Content,
                          [PublishedTime] = @PublishedTime, [Tag_ID] = @Tag_ID, [Dec] = @Dec, 
                          [ViewNum] = @ViewNum WHERE [ArticleID] = @ArticleID">
            <DeleteParameters>
                <asp:Parameter Name="ArticleID" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="Title" Type="String" />
                <asp:Parameter Name="A_Content" Type="String" />
                <asp:Parameter DbType="Date" Name="PublishedTime" />
                <asp:Parameter Name="Tag_ID" Type="Int32" />
                <asp:Parameter Name="Dec" Type="String" />
                <asp:Parameter Name="ViewNum" Type="Int32" />
                <asp:Parameter Name="ArticleID" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="Title" Type="String" />
                <asp:Parameter Name="A_Content" Type="String" />
                <asp:Parameter DbType="Date" Name="PublishedTime" />
                <asp:Parameter Name="Tag_ID" Type="Int32" />
                <asp:Parameter Name="Dec" Type="String" />
                <asp:Parameter Name="ViewNum" Type="Int32" />
            </InsertParameters>
        </asp:SqlDataSource>
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            DataKeyNames="ArticleID" DataSourceID="SqlDataSource1">
            <Columns>
                <asp:BoundField DataField="ArticleID" HeaderText="ArticleID" 
                    InsertVisible="False" ReadOnly="True" SortExpression="ArticleID" />
                <asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />
                <asp:BoundField DataField="A_Content" HeaderText="A_Content" 
                    SortExpression="A_Content" />
                <asp:BoundField DataField="PublishedTime" HeaderText="PublishedTime" 
                    SortExpression="PublishedTime" />
                <asp:BoundField DataField="Tag_ID" HeaderText="Tag_ID" 
                    SortExpression="Tag_ID" />
                <asp:BoundField DataField="Dec" HeaderText="Dec" SortExpression="Dec" />
                <asp:BoundField DataField="ViewNum" HeaderText="ViewNum" 
                    SortExpression="ViewNum" />
            </Columns>
        </asp:GridView>
    
    </div>
    </form>
</body>
</html>
