SiteMap  | About    

Detailsview Update

DetailsView generates a user interface similar to the Form View of a Microsoft Access database, and is typically used for updating/deleting any currently displayed record or for inserting new records. You can use the DetailsView control to update existing database records. In order to update an existing record, assign the value True to the DetailsView controls AutoGenerateEditButton property .



If you want the DetailsView control to initially appear in Edit mode, then you can set the DetailsView controls DefaultMode property to the value Edit.



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<head id="Head1" runat="server">
	<title>Untitled Page</title>
	<form id="form1" runat="server">
		<asp:DetailsView id="DetailsView1" DataSourceID="SqlDataSource1"  DataKeyNames="stor_id"
		AllowPaging ="true" Runat="server" AutoGenerateEditButton="true" />
		<asp:SqlDataSource ID="SqlDataSource1" runat="server"
		ConnectionString="<%$ ConnectionStrings:SQLDbConnection %>"
		SelectCommand="select * from [stores]"
		UpdateCommand="UPDATE [stores] SET stor_name=@stor_name,stor_address=@stor_address,city=@city,
		state=@state, zip=@zip WHERE stor_id=@stor_id" />
</html> (C) 2018    Founded by raps mk
All Rights Reserved. All other trademarks are property of their respective owners.