ASP.NET
  Home arrow ASP.NET arrow Page 2 - Introducing ASP.NET 2.0: GridView Control
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  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Mobile Linux 
App Generation ROI 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
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

Introducing ASP.NET 2.0: GridView Control
By: Anand Narayanaswamy
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 64
    2005-07-11

    Table of Contents:
  • Introducing ASP.NET 2.0: GridView Control
  • Create the Database
  • Save and Run
  • Adding Paging Functionality to GridView
  • Updating Data

  • 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


    Introducing ASP.NET 2.0: GridView Control - Create the Database


    (Page 2 of 5 )

    Create a Microsoft Access database and the required table under it. Be sure to add some data to the table and move the database to the App_Data directory of the project folder.

    Figure 3

    Your next step is to configure the AccessDataSource control appropriately. For this purpose, select the Configure Data Source item from the balloon tip as shown in the above screenshot. You will be presented with a series of wizards as shown in Figures 4 and 5.

    Figure 4

    You have to manually type in the path of your MS Access database. I found that the Browse feature has not yet been fully implemented. Select the Next button to continue.

     

    Figure 5

    You must select the field names from the above wizard. As soon as you select the required columns, the select statement will be updated accordingly.

    Figure 6

    Initially, the required data will not appear as shown in the above screenshot. You have to click the Test Query button to complete this step. Visual Studio 2005 will display the data provided your database connection is properly set up. You will be returned to the Design View after this step.

    Select the GridView control and set the DataSourceID property to AccessDataSource1. You will have to copy and paste the control name as the IDE will not automatically populate the same. Also set the DataMember property to DefaultView.

    Finally, set the DataKeyNames property by clicking the ellipse. You will have to add the required field names from the left side to the right side list box (See Figure 7).

    Figure 7

    More ASP.NET Articles
    More By Anand Narayanaswamy


       · I'm Aannd - the author of this article. Please go through the article and let me...
       · I can't get this to work. I keep getting the error...
       · Hi, i am rachel.i did the method as u posted here. but my delete button doesnt...
       · Did your @<column name> match what was in the "<asp:BoundField DataField="?
       · hi I am algo getting the same errror with delete action.sudha
       · hello, how about when xml is our datasource?
     

    ASP.NET ARTICLES

    - Disadvantages of the ASP.NET MVC Framework
    - Advantages of the ASP.NET MVC Approach
    - ASP.NET Web Forms Weaknesses
    - ASP.NET Web Forms Meets ASP.NET MVC
    - Source Code for Saving and Retrieving Data w...
    - Using GridView to Save and Retrieve Data wit...
    - Handling Dynamic Images in ASP.NET 3.5 AJAX ...
    - Retrieving Data with AJAX and the GridView C...
    - Playing with Images in ASP.NET 3.5 AJAX Appl...
    - Saving and Retrieving Data with AJAX
    - Enhancing PHP Via the ASP.NET AJAX Framework...
    - Enhancing PHP Programming with the ASP.NET A...
    - Classes and ASP.NET AJAX
    - Using ASP.NET AJAX
    - Building a Simple Storefront with LINQ





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
    Stay green...Green IT