且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

详细信息视图中的运行时更新命令

更新时间:2022-12-06 09:22:35

Connectionstrings:con1%>" SelectCommand =" UpdateCommand =" 运行 =" / > < > < tr > td < asp:DetailsView ID =" runat =" span> DataSourceID =" AutoGenerateRows =" BackColor =" ForeColor =" BorderColor =" OnItemUpdating =" AllowPaging =" 字体粗体 =" 字体大小 =" GridLines =" 无" 宽度 317px" > 跨度> < 字段 > < asp:BoundField HeaderText =" DataField staffname " / < asp:BoundField HeaderText =" DataField qualify " / < asp:BoundField HeaderText =" DataField 名称" / < asp:BoundField HeaderText =" DataField 地址" / < asp:BoundField HeaderText =" DataField ctno" / < asp:BoundField HeaderText =" DataField =" dob" / > 跨度> < asp:BoundField HeaderText =" DataField 薪水" / < asp:BoundField HeaderText =" DataField =" 加入日期" / < asp:BoundField HeaderText =" DataField="department " /> <asp:BoundField HeaderText="Branch" DataField="branch" /> <asp:BoundField HeaderText="Subjects Taken" DataField="subtaken" /> <asp:BoundField HeaderText="User Name" DataField="username" /> <%-- <asp:BoundField HeaderText="Password" DataField="password"/>--%> < asp:CommandField ShowEditButton =" / < /fields > <pagersettings mode="NextPreviousFirstLast" firstpagetext="First" lastpagetext="Last" nextpagetext="Next" previouspagetext="Previous" /<pagerstyle backcolor="White" forecolor="HotPink" /> <HeaderStyle BackColor="White" ForeColor="#FF3399" HorizontalAlign="Center" /> <insertrowstyle wrap="True" /> < HeaderTemplate > <asp:Label ID="Label1" runat="server" Text="Staff Details" Font-Size="Large"> < /HeaderTemplate > <alternatingrowstyle backcolor="White" font-bold="True" forecolor="#0033CC" /> </td></tr></table>
Connectionstrings:con1%>" SelectCommand="SELECT staffname,qualify,designation,address,ctno,dob,salary,dateofjoining,department,branch,subtaken,username FROM staff where id='5'" UpdateCommand="Update staff SET staffname=@staffname,qualify=@qualify, designation=@designation,address=@address, ctno=@ctno, dob=@dob, salary=@salary, dateofjoining=@dateofjoining,department=@department,branch=@branch,subtaken=@subtaken, username=@username where id='5'" runat="server"/> <table><tr><td> <asp:DetailsView ID="DetailsView2" runat="server" DataSourceID="MyDataSource" AutoGenerateRows="False" BackColor="#FFD7FF" ForeColor="#0033CC" BorderColor="LightSlateGray" OnItemUpdating="UpdateRecord" AllowPaging="True" Font-Bold="True" Font-Size="Medium" GridLines="None" Width="317px" > <fields> <asp:BoundField HeaderText="Name" DataField="staffname" /> <asp:BoundField HeaderText="Qualification" DataField="qualify" /> <asp:BoundField HeaderText="Designation" DataField="designation" /> <asp:BoundField HeaderText="Address" DataField="address" /> <asp:BoundField HeaderText="Contact No" DataField="ctno" /> <asp:BoundField HeaderText="Date Of Birth" DataField="dob" /> <asp:BoundField HeaderText="Salary" DataField="salary" /> <asp:BoundField HeaderText="Date Of Joining" DataField="dateofjoining" /> <asp:BoundField HeaderText="Department" DataField="department" /> <asp:BoundField HeaderText="Branch" DataField="branch" /> <asp:BoundField HeaderText="Subjects Taken" DataField="subtaken" /> <asp:BoundField HeaderText="User Name" DataField="username" /> <%-- <asp:BoundField HeaderText="Password" DataField="password" />--%> <asp:CommandField ShowEditButton="True" /> </fields> <pagersettings mode="NextPreviousFirstLast" firstpagetext="First" lastpagetext="Last" nextpagetext="Next" previouspagetext="Previous" /> <pagerstyle backcolor="White" forecolor="HotPink" /> <HeaderStyle BackColor="White" ForeColor="#FF3399" HorizontalAlign="Center" /> <insertrowstyle wrap="True" /> <HeaderTemplate> <asp:Label ID="Label1" runat="server" Text="Staff Details" Font-Size="Large"> </HeaderTemplate> <alternatingrowstyle backcolor="White" font-bold="True" forecolor="#0033CC" /> </td></tr></table>