动态组合SQL语句方式实现批量更新的实例

动态组合SQL语句方式实现批量更新的实例

Default.aspx

复制代码 代码如下:


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

<!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 runat="server">
    <div><asp:Panel runat="server">
        <asp:GridView runat="server" AutoGenerateColumns="False"
            OnRowDataBound="GridView1_RowDataBound"
            OnSelectedIndexChanging="GridView1_SelectedIndexChanging" Font-Size="9pt"
            AllowPaging="True" EmptyDataText="没有相关数据可以显示!"
            OnPageIndexChanging="GridView1_PageIndexChanging" CellPadding="4"
            ForeColor="#333333" GridLines="None" DataKeyNames="id">
                <Columns>
                     <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:CheckBox runat="server" />
                                </ItemTemplate>
                      </asp:TemplateField>
                    <asp:BoundField DataField="id" HeaderText="信息ID" />
                    <asp:BoundField DataField="name" HeaderText="信息主题" />
                    <asp:BoundField DataField="type" HeaderText="信息分类" />
                    <asp:BoundField DataField="content" HeaderText="发布内容" />
                    <asp:BoundField DataField="userName" HeaderText="发布人" />
                    <asp:BoundField DataField="lineMan" HeaderText="联系人" />
                    <asp:BoundField DataField="issueDate" HeaderText="发布时间"
                        DataFormatString="{0:d}" />
                </Columns>
                <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
                <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Right" />
                <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                <AlternatingRowStyle BackColor="White" />
            </asp:GridView>
        </asp:Panel>
                    <asp:CheckBox runat="server" AutoPostBack="True"
            Font-Size="9pt" OnCheckedChanged="cbAll_CheckedChanged"
                        Text="全选/反选" />

        <asp:Button runat="server"
            Text="更新发布时间" />

    </div>
    </form>
</body>
</html>

Default.aspx.cs

复制代码 代码如下:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wjdydf.html