
<asp:DetailsView ID="DetailsView1" runat="server"
AllowPaging="true" DataKeyNames="Code"
DataSourceID="MyDataSource" AutoGenerateRows="false"
OnDataBound="DetailsView1_DataBound"
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"/>
protected void DetailsView1_DataBound(object sender, EventArgs e)
{
string description=DetailsView1.Rows[1].Cells[1].Text;
}
Copyright © 2012 - All Rights Reserved - VKInfotek.com