<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1"
EmptyDataText="没有可显示的数据记录。" AllowPaging="True" AllowSorting="True" OnRowDataBound="GridView1_RowDataBound" BackColor="White" BorderColor="#E7E7FF" BorderStyle="None" BorderWidth="1px" CellPadding="3" GridLines="Horizontal" Width="576px" OnRowCommand="GridView1_RowCommand" OnPageIndexChanged="GridView1_PageIndexChanged" OnRowCreated="GridView1_RowCreated" OnSorting="GridView1_Sorting" AutoGenerateEditButton="True" DataKeyNames="MATERIALCODE,MATERIALNAME,SPEC" AutoGenerateSelectButton="True">
<FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
<RowStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" Font-Size="Smaller"/>
<SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
<PagerStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" Font-Size="Smaller" HorizontalAlign="Center" />
<HeaderStyle BackColor="#4A3C8C" Font-Bold="True" Font-Size="Smaller" ForeColor="#F7F7F7" />
<AlternatingRowStyle BackColor="#F7F7F7" />
<PagerSettings FirstPageText="首页" LastPageText="末页" Mode="NextPreviousFirstLast"
NextPageText="下一页" PreviousPageText="上一页" />
<Columns>
<asp:BoundField DataField="MATERIALNAME" HeaderText="MATERIALNAME" SortExpression="MATERIALNAME" />
<asp:BoundField DataField="MATERIALCODE" HeaderText="MATERIALCODE" ReadOnly="True"
SortExpression="MATERIALCODE" />
<asp:BoundField DataField="SPEC" HeaderText="SPEC" SortExpression="SPEC" />
<asp:ButtonField ButtonType="Button" CommandName="add" HeaderText="newbutton" ShowHeader="True"
Text="按钮" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString1 %>"
ProviderName="<%$ ConnectionStrings:ConnectionString1.ProviderName %>"
SelectCommand='SELECT "MATERIALNAME", "MATERIALCODE", "SPEC" FROM "TB_MATERIALITEM"'
UpdateCommand='UPDATE TB_MATERIALITEM SET MATERIALNAME = :MATERIALNAME,SPEC = :SPEC WHERE MATERIALCODE =:MATERIALCODE' >
<UpdateParameters>
<asp:Parameter Name="MATERIALCODE" />
<asp:Parameter Name="SPEC" />
<asp:Parameter Name="MATERIALNAME" />
</UpdateParameters>
</asp:SqlDataSource>
EmptyDataText="没有可显示的数据记录。" AllowPaging="True" AllowSorting="True" OnRowDataBound="GridView1_RowDataBound" BackColor="White" BorderColor="#E7E7FF" BorderStyle="None" BorderWidth="1px" CellPadding="3" GridLines="Horizontal" Width="576px" OnRowCommand="GridView1_RowCommand" OnPageIndexChanged="GridView1_PageIndexChanged" OnRowCreated="GridView1_RowCreated" OnSorting="GridView1_Sorting" AutoGenerateEditButton="True" DataKeyNames="MATERIALCODE,MATERIALNAME,SPEC" AutoGenerateSelectButton="True">
<FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
<RowStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" Font-Size="Smaller"/>
<SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
<PagerStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" Font-Size="Smaller" HorizontalAlign="Center" />
<HeaderStyle BackColor="#4A3C8C" Font-Bold="True" Font-Size="Smaller" ForeColor="#F7F7F7" />
<AlternatingRowStyle BackColor="#F7F7F7" />
<PagerSettings FirstPageText="首页" LastPageText="末页" Mode="NextPreviousFirstLast"
NextPageText="下一页" PreviousPageText="上一页" />
<Columns>
<asp:BoundField DataField="MATERIALNAME" HeaderText="MATERIALNAME" SortExpression="MATERIALNAME" />
<asp:BoundField DataField="MATERIALCODE" HeaderText="MATERIALCODE" ReadOnly="True"
SortExpression="MATERIALCODE" />
<asp:BoundField DataField="SPEC" HeaderText="SPEC" SortExpression="SPEC" />
<asp:ButtonField ButtonType="Button" CommandName="add" HeaderText="newbutton" ShowHeader="True"
Text="按钮" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString1 %>"
ProviderName="<%$ ConnectionStrings:ConnectionString1.ProviderName %>"
SelectCommand='SELECT "MATERIALNAME", "MATERIALCODE", "SPEC" FROM "TB_MATERIALITEM"'
UpdateCommand='UPDATE TB_MATERIALITEM SET MATERIALNAME = :MATERIALNAME,SPEC = :SPEC WHERE MATERIALCODE =:MATERIALCODE' >
<UpdateParameters>
<asp:Parameter Name="MATERIALCODE" />
<asp:Parameter Name="SPEC" />
<asp:Parameter Name="MATERIALNAME" />
</UpdateParameters>
</asp:SqlDataSource>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货