Introduction
DetailsView is a DataBound control of ASP.NET used to display a single record from a DataSource in the form of a table, where each row represents a field of the record. The DetailsView control allows you to insert, edit and delete records.
Building the Sample
- Download my Sample.
- Change Connection String in web.config file.
- <connectionStrings>
- <add name="MyConnection"
- connectionString="Data Source=MONISH-PC\MONISH;Initial Catalog=master;Persist Security Info=True;User ID=saty;Password=1234"
- providerName="System.Data.SqlClient" />
- </connectionStrings>
- Execute the product table in SQL server.
- USE [master]
- GO
- /****** Object: Table [dbo].[Product] Script Date: 08/16/2012 19:46:27 ******/
- SET ANSI_NULLS ON
- GO
- SET QUOTED_IDENTIFIER ON
- GO
- SET ANSI_PADDING ON
- GO
- CREATE TABLE [dbo].[Product](
- [pk_id] [int] IDENTITY(1,1) NOT NULL,
- [ProductId] [varchar](5) NULL,
- [ProductName] [varchar](50) NULL,
- [ProductPrice] [numeric](8, 2) NULL,
- [ProductLocation] [varchar](25) NULL,
- [ProductQuantity] [varchar](10) NULL,
- PRIMARY KEY CLUSTERED
- (
- [pk_id] ASC
- )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
- ) ON [PRIMARY]
- GO
- SET ANSI_PADDING OFF
- GO




nismi varghesePosted Jul 24, 2019, 1:59 AM
Can u pls share the code