Blog Home  Home Feed your aggregator (RSS 2.0)  
What did you learn today? - 70-551 - Section II Part IV - Data binding
Phil Denoncourt's Technology Rants
 
 Sunday, February 26, 2006

UPGRADE: MCAD Skills to MCPD Web Developer by Using the Microsoft .NET Framework

Implement data-bound controls.

  • Use tabular data source controls to return tabular data.
  • Use hierarchical data source controls to display hierarchical data.
  • Display data by using simple data-bound controls.
  • Display data by using composite data-bound controls.
  • Display data by using hierarchical data-bound controls.
  • Use the FormView control to display the values of a single table record from a data source.

Tabular data source controls would be the SqlDataSource, AccessDataSource, and ObjectDataSource.  SqlDataReader and AccessDataSources should be self explanatory.  The ObjectDatasource allows the binding of custom business objects, including datasets.  GridViewGuy has a walkthrough on using the component on his site.

There are two hierarchical data source controls.  SiteMapDataSource, and the XmlDataSource.  The SiteMapDataSource reads SiteMap info from the SiteMapProvider for the website.  It keeps current as the user navigates the website.  The XmlDataSource allows you to bind XML.  Keyvan Nayyeri has a tutorial on the XMLDataSource at CodeProject.

Most web controls can be bound.  You should know the difference between Eval (Readonly data) and Bind(Two way binding; data might be changed).  There is an article at MSDN on this.

Composite Databound controls are the Gridview, DataList,  DetailsView and the Repeater.  Dino Esposito has an article at MSDN on the GridView.  It's old, but it still applies.  Wei Meng Lee has an article on the Datalist.  The data reader doesn't seem to have changed.   GridViewGuy has an article on the DetailsView.

To display hierarchical data, you can use the new TreeView.  Technically, you could also use the SiteMapPath or the Menu.  Thiru Thangarathinam has a very comprehensive article on binding with this control at 15seconds.

The FormView is a templated control that works on a record by record basis.  You provide a readonly layout in the ItemTemplate, and a layout for edits in the EditItemTemplate. There is an overview at ASP.NET.

Next up -> Database Connections

Sunday, February 26, 2006 5:01:15 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Certifications  | 
Comments are closed.
Copyright © 2009 Phil Denoncourt III. All rights reserved.
DasBlog 'Portal' theme by Johnny Hughes.
Pick a theme: