Asp.net 我想在网格视图可编辑文本框中插入数据库值,从中可以更新该文本框
我拿了这个,但它没有与数据库绑定。文本框显示为空。首先,我建议浏览 我会给你一个总的指导,让你走上正确的道路Asp.net 我想在网格视图可编辑文本框中插入数据库值,从中可以更新该文本框,asp.net,gridview,visual-studio-2008,Asp.net,Gridview,Visual Studio 2008,我拿了这个,但它没有与数据库绑定。文本框显示为空。首先,我建议浏览 我会给你一个总的指导,让你走上正确的道路 添加如下命令字段: 在行更新事件中实现“保存到数据库”代码 第一次这样做可能有点棘手,但一旦你把它记下来,就很容易了 <asp:GridView ID="grdAttendance1" runat="server" AutoGenerateColumns="False" CellPadding="4" ForeColor="#33
- 在行更新事件中实现“保存到数据库”代码李>
<asp:GridView ID="grdAttendance1" runat="server" AutoGenerateColumns="False" CellPadding="4"
ForeColor="#333333" GridLines="None" Width="100%" HorizontalAlign="Center">
<AlternatingRowStyle BackColor="White" />
<Columns>
<asp:BoundField DataField="InstID" HeaderText="College ID" />
<asp:BoundField DataField="Fid" HeaderText="Employee ID" />
<asp:BoundField DataField="FName" HeaderText="Employee Name" />
<asp:BoundField DataField="Designation" HeaderText="Designation" />
<asp:BoundField DataField="Department" HeaderText="Department" />
<asp:BoundField DataField="Date" HeaderText="Date" />
<asp:TemplateField HeaderText="In Time">
<ItemTemplate>
<asp:TextBox ID="txtIntime1" runat="server"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Out Time">
<ItemTemplate>
<asp:TextBox ID="txtOuttime1" runat="server"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Leave Type">
<ItemTemplate>
<asp:TextBox ID="txtLeaveType1" runat="server"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<EditRowStyle BackColor="#2461BF" />
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<RowStyle BackColor="#EFF3FB" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<SortedAscendingCellStyle BackColor="#F5F7FB" />
<SortedAscendingHeaderStyle BackColor="#6D95E1" />
<SortedDescendingCellStyle BackColor="#E9EBEF" />
<SortedDescendingHeaderStyle BackColor="#4870BE" />
</asp:GridView>