Chapter 11. Data Binding on Web Forms


ASP.NET Developer's JumpStart
By Paul D. Sheriff, Ken Getz
Table of Contents
Part II.  Data Handling


  • Learn to load a DataGrid control on a Web Form with data

  • Learn to load a ComboBox control on a Web Form with data

Although you could write all the code necessary to open a data source, retrieve the data, and fill in controls on an ASPX page, you needn't do this. Web Forms can use ADO.NET under the covers to handle all the "plumbing" for you. Using data binding, you do not need to explicitly write the code that instantiates a connection and creates a DataSet (as you would if you were creating an unbound form). Visual Studio .NET includes tools to create the necessary Connection and Command objects for you, and ASP.NET controls include code that allows them to bind to these data objects with very little code. Web Forms allow you to bind easily to almost any structure that contains data. You can bind Web Forms to traditional data stores, such as data stored in a Microsoft SQL Server or Oracle database, or you can bind to the result of data read from text files, data within other controls, or data stored in an array. In this chapter, you will learn to bind to a SQL Server table.

You're most likely going to want to be able to bind the DataGrid, ListBox, and DropDownList controls to data sources. We'll focus on these controls, then, in this chapter, and show how you can display data from a SQL Server table in each of these controls.


    ASP. NET Developer's JumpStart
    ASP.NET Developers JumpStart
    ISBN: 0672323575
    EAN: 2147483647
    Year: 2002
    Pages: 234 © 2008-2017.
    If you may any questions please contact us: