Monday, November 24, 2008

Working with the New Data Source Controls in ASP.NET

With ASP.NET 2.0 and after, you are introduced to a bunch of new data source controls, i.e., LinqDataSource, ObjectDataSource, XmlDataSource, SqlDataSource, etc. You can use the newly added data source controls of ASP.NET 2.0 to implement CRUD (Create, Read, Update, and Delete) operations in your applications without having to write much code. All of these controls support paging, sorting, caching, editing, inserting, selecting and deleting data. You can use these controls to bind data to your ASP.NET data bound controls (GridView, Repeater, ListView, etc) declaratively, i.e., without writing even a single line of code. This article discusses these controls and how easily one can work with them.

The New Data Source Controls of ASP.NET 2.0
ASP.NET 2.0 and beyond ships with a lot of data source controls, namely:

- ObjectDataSource
- SQLDataSource
- AccessDataSource
- XMLDataSource
- LinqDataSource

Besides these controls, you also have the SiteMapDataSource control that can be used to loads a site map file and expose it to controls such as the TreeView and SiteMapPath. Using these controls is easy: simply drag and drop one from the toolbox into your web form in the design view mode in Visual Studio.

Read More..

No comments: