Click here to Skip to main content
15,893,722 members
Articles / Web Development / ASP.NET

Editable GridView in ASP.NET 2.0

Rate me:
Please Sign up or sign in to vote.
4.66/5 (131 votes)
26 Nov 2012CPOL2 min read 1.1M   55.5K   213  
This article will give you an overview of how to use an ASP.NET GridView completely, and how to use RowEditing, RowUpdating, RowDeleting, RowCommand, RowDataBound, RowCancelingEdit, and Pagination in a DataGrid. From this article, you will have a clear view of GridView data inserting, deleting, and
��USE [TestDatabase]

GO

/****** Object:  Table [dbo].[Contact]    Script Date: 11/26/2012 10:18:38 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

SET ANSI_PADDING ON

GO

CREATE TABLE [dbo].[Contact](

	[Id] [int] IDENTITY(1,1) NOT NULL,

	[Name] [varchar](100) NULL,

	[Sex] [varchar](50) NULL,

	[Type] [varchar](50) NULL,

	[IsActive] [bit] NULL,

 CONSTRAINT [PK_Contact_1] PRIMARY KEY CLUSTERED 

(

	[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



INSERT INTO Contact values('Ashrafur Rahaman','Male','3',1);



GO

/****** Object:  Table [dbo].[ContactType]    Script Date: 11/26/2012 10:18:51 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

SET ANSI_PADDING ON

GO

CREATE TABLE [dbo].[ContactType](

	[Id] [int] IDENTITY(1,1) NOT NULL,

	[TypeName] [varchar](50) NULL,

 CONSTRAINT [PK_ContactType] PRIMARY KEY CLUSTERED 

(

	[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

INSERT INTO ContactType values('Friends');

INSERT INTO ContactType values('Family');

INSERT INTO ContactType values('Business');

INSERT INTO ContactType values('Personal');

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
Canada Canada
Software engineer with broad experience in enterprise application development, product deployment automation, software test & test automation, application & system management, and manage big projects and team using proven agile technologies.

Passionate on Microsoft technologies, developed solutions using C#, .net (1.1/2.0/3.5/4), SQL Server (2005/2008). Work on Powershell, SSRS, SSIS, WPF, Ajax, WCF, JQuery.

Develop innovative application with cutting edge technologies always boosting inside.

Comments and Discussions