ASP.NET
  Home arrow ASP.NET arrow Binding Data to Controls
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP.NET

Binding Data to Controls
By: McGraw-Hill/Osborne
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 10
    2006-04-27

    Table of Contents:
  • Binding Data to Controls
  • The Repeater Control
  • A Closer Look at Templates
  • Drop-Down List

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Binding Data to Controls


    (Page 1 of 4 )

    Looking for a way to writer fewer lines of code while streamlining your ASP.NET application? This article, the first of two parts, shows you one way to do this. It is excerpted from chapter 12 of ASP.NET 2.0 DeMYSTiFieD, written by Jim Keogh (McGraw-Hill/Osborne; ISBN: 0072261412).

    Developers are always looking for efficient ways to streamline an application and reduce lines of code to write. One of those ways is to link data directly to a web control so that it appears automatically every time the web page is displayed.

    Linking data to a web control is called data binding and is the topic of this chapter. Data can come from a variety of sources, but the most common source is from a database. In this chapter, you’ll learn how to bind data to a web control and then use that data and web control within your application.

    Data Binding Basics

    In previous chapters you learned how to retrieve information from a database and display the information on your web page. Many times this information is displayed in a control such as a drop-down list box or a text box on a web form.

    You can dynamically assign information from a database to a control by using a process called data binding. Data binding links the value property of a control to a data source while your application is running. The data source can be data from a database. The data source can also be an expression, methods, or properties of another control.

    Each control has a DataSource property that specifies the source of the data for the control. Each control also has a DataBind() method. You call the DataBind() method whenever you want to bring the data source into the control.

    Throughout this chapter we’ll show how to bind data from a database to a Repeater control, a drop-down list control, a radio button control, and a list box control.

    More ASP.NET Articles
    More By McGraw-Hill/Osborne


       · This article is an excerpt from the book "ASP.NET 2.0 DeMYSTiFieD," published by...
     

    Buy this book now. This article is excerpted from chapter 12 of ASP.NET 2.0 DeMYSTiFieD, written by Jim Keogh (McGraw-Hill/Osborne; ISBN: 0072261412). Check it out today at your favorite bookstore. Buy this book now.

    ASP.NET ARTICLES

    - ASP.NET DotNetNuke Installation with Visual ...
    - Using ASP.NET with a MySQL Database
    - Using ASP.NET with an MS Access Database
    - Adding Content to a Static ASP.NET Website
    - Building a Static ASP.NET Website in a Basic...
    - Develop Your First ASP.NET Website with Visu...
    - Run ASP.NET in Windows XP Home with Cassini ...
    - How to Test a Web Application
    - How to Add Code and Validation Controls to a...
    - Working in Source and Split Views to Build a...
    - How to Build a Web Form for a One-Page Web A...
    - How to Develop a One-Page Web Application
    - An ASP.NET Web Application in Action
    - Developing ASP.NET Web Applications
    - An Introduction to ASP.NET Web Programming





    © 2003-2010 by Developer Shed. All rights reserved. DS Cluster 11 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek