WCF And ListView Insert Update And Delete Rows In ASP.NET

In this article you will learn how to edit, update and delete in ListView. First drag and drop ListView. In ListView, next open Default.aspx source code. To make a column in Listview use <LayoutTemplate>. Here first I created a table name 'Product' in my database. It contains 5 columns: ProductId, ProductName,ProductLocation,ProductQuantity, and ProductPrice.

In this article you will learn how to edit, update and delete in ListView. First drag and drop ListView. In ListView, next open Default.aspx source code. To make a column in Listview use <LayoutTemplate>. Here first I created a table name 'Product' in my database. It contains 5 columns: ProductId, ProductName,ProductLocation,ProductQuantity, and ProductPrice.

Download my sample.

Inside that folder person.sql file will be there; execute it in your database.

Change the connection string in web.config file

Building the Sample

This sample is written using three tier architecture so you have to add references.

The ASP.NET ListView control enables you to bind to data items that are returned from a data source and display them. You can display data in pages. You can display items individually, or you can group them.

The ListView control displays data in a format that you define by using templates and styles. It is useful for data in any repeating structure, similar to the DataList and Repeater controls. However, unlike those controls, with the ListView control you can enable users to edit, insert, and delete data, and to sort and page data, all without code.