ASP
  Home arrow ASP arrow ADO.NET 101: Data Rendering with a DataGri...
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

ADO.NET 101: Data Rendering with a DataGrid Control
By: Jayaram Krishnaswamy
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 78
    2005-11-22

    Table of Contents:
  • ADO.NET 101: Data Rendering with a DataGrid Control
  • Displaying Data from DataReader with a DataGrid Control
  • Connecting to a SQL Server database
  • Adding a SQL Connection
  • Adding a SQLCommand
  • Display formatted data using AutoFormat
  • Formatting via Code

  • 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


    ADO.NET 101: Data Rendering with a DataGrid Control


    (Page 1 of 7 )

    This tutorial explains how to use an iterative RAD technique for displaying the data from a DataReader. It offers flexible, free form formatting.

    Introduction

    This how-to tutorial describes displaying the data from a DataReader using the DataGrid Iterative data bound control. In earlier  tutorials displaying data using the data bound RepeaterControl and a DataList control were described. This tutorial is self-contained like the others, however, the reader will find it helpful to review the earlier tutorials here and here, which were related to the data being retrieved using the DataReader.

    The iterative RAD technique described in this tutorial offers  flexible, free form formatting of displayed data. When the controls are bound to a data source, the three controls Repeater, DataList, and DataGrid loop through the data row by row, and apply a template (html) in rendering on a row by row basis. Each of the controls has its own way of formatting the data. In this tutorial the several ways that data can be formatted is described.

    DataReader is unbeatable for fast retrieval of data from a database. However it is only suited for Read-only, Forward- only type of data retrieval. The iterative controls can fire specialized events. In this tutorial we are only looking at binding the data to the DataReader and configuring the control. Also, data retrieved using a DataReader cannot be sorted; more on this later.

    Iterative Controls

    The following picture shows the three controls in VS 2003 IDE's toolbox. The DataList and DataGrid icons show intuitively that they are related to data.

    the three iterative controls

    What makes the DataGrid such a flexible tool is the large number of properties and methods available for the designer as seen in the following class view for DataGrid.

    Data Grid Class

    More ASP Articles
    More By Jayaram Krishnaswamy


       · "When the controls are bound to a data source, the three controls Repeater,...
       · I was away on a holiday where I did not have access to a computer(unbelievable, but...
     

    ASP ARTICLES

    - Using MySQL with ASP
    - ADO for the Beginner
    - ADO.NET 101: Data Rendering with a DataGrid ...
    - Introducing SoftArtisans OfficeWriter 3.0 En...
    - Getting Remote Files With ASP
    - The Real Basics of Functions in ASP
    - Enhancing Readability with ASP
    - Mimicking PHP's String Formatting Functions
    - Windows Server Hacks 12, 77, and 98
    - How to Sort a Multi-Dimensional Array
    - Developing an Information Management Tool wi...
    - What are Active Server Pages?
    - Getting Remote Pages with ASP
    - FTP’ing Files with ASP
    - Apply Single-Sign-On to Your Application





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