
BoundField - Displays the value of a data item as text CheckBoxField - Displays the value of a data item as check box CommandField - Displays links for editing, deleting and selecting ButtonField - Displays the value of a data item as a button HyperLinkField - Displays the value of a data item as link ImageField - Displays the value of a data item as image TemplateField - Enables customization of the appearance of a data item
<asp:DetailsView ID="DetailsView1" runat="server" AllowPaging="true" DataKeyNames="Code" DataSourceID="MyDataSource" AutoGenerateRows="false" AutoGenerateInsertButton="true" AutoGenerateEditButton="true"> <Fields> <asp:BoundField DataField="Name" HeaderText="Name" /> <asp:BoundField DataField="Description" HeaderText="Description" /> </Fields> </asp:DetailsView> <asp:SqlDataSource ID="MyDataSource" ConnectionString="<%$Connectionstrings:ERPConnectionString%>" SelectCommand="SELECT * FROM Sample" UpdateCommand="Update SAMPLE SET Name=@Name,Description=@Description Where Code=@Code" DeleteCommand="Delete SAMPLE Where Code=@Code" InsertCommand="Insert SAMPLE(Code,Name,Description) VALUES(@Code,@Name,@Description)" runat="server"/>
Copyright © 2012 - All Rights Reserved - VKInfotek.com