Hello there, here i m explaining how to use Databound fields
using gridview .
Now first of all we will create a database. Here the following script, copy it and run
it.
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tbEmp]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[tbEmp](
[id] [int] IDENTITY(1,1) NOT NULL,
[name] [varchar](50) NULL,
[age] [int] NULL,
[address] [varchar](50) NULL
) ON [PRIMARY]
END
Place the
GridView control on a form and set the following property.
AutoGenerateColumns="False"
And set
the Gridview Events name is
onrowcancelingedit="GridView1_RowCancelingEdit"
onrowdeleting="GridView1_RowDeleting" onrowediting="GridView1_RowEditing"
onrowupdating="GridView1_RowUpdating"
Or add the default.aspx page and paste the following source
code in it.