ASP.NET
  Home arrow ASP.NET arrow The Simplest CRUD Operations for Lookup Ta...
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 
Dedicated Servers 
Moblin 
JMSL Numerical Library 
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

The Simplest CRUD Operations for Lookup Tables in ASP.NET
By: Jagadish Chaterjee
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 20
    2006-06-28

    Table of Contents:
  • The Simplest CRUD Operations for Lookup Tables in ASP.NET
  • The SQLHelper
  • The SQLHelper: continued
  • Retrieving information from the database
  • Dealing with DML operations
  • Dealing with DML Operations: continued
  • Points to note

  • 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


    The Simplest CRUD Operations for Lookup Tables in ASP.NET


    (Page 1 of 7 )

    This article introduces you to implementing the fastest way to include CRUD operations for lookup tables in ASP.NET.
    A downloadable file for this article is available here.

    The Design

    In general, every application needs a few lookup tables.  These lookup tables are also considered "system parameters" by many developers.  It is not a hurdle at all to write CRUD (Create, Read, Update, Delete) operations using ASP.NET.  But there exist too many methods for implementing these operations. In this article, I shall introduce you to the fastest template to include CRUD operations, which is very suitable for lookup tables. 

    In my sample, I actually worked with existing "flow" and "grid" layouts. It may not be suitable for certain browsers.  If you want extreme browser compatibility, I suggest you to modify the screen design with HTML tables and panels. 

    My sample mainly contains a datagrid and a "server grid layout" control (with few buttons to operate).  All of them have been pushed into a flow layout control for  intelligent maintenance of space on the web page.  The datagrid is equipped with two added columns as specified below:

      <Columns>
       
    <asp:ButtonColumn  Text="&lt;img border=0 
          src='images/icon_edit.gif'&gt;"
     CommandName="OnEdit">
           </
    asp:ButtonColumn>

        <asp:ButtonColumn  Text="&lt;img border=0
          src='images/icon_Delete.gif'&gt;"
     CommandName="OnDel">
           </
    asp:ButtonColumn>
      </Columns>

    From the above you can understand that I simply added two Button Columns to the data grid to work with "edit" and "delete" operations for the respective row.  I am getting the connection string from the web.config using the following statement in the class SQLHelper.

      Dim _ConnectionString As String =
        System.Configuration.ConfigurationSettings.AppSettings.Get
        ("ConnectionString")

    For this demonstration, I simply modified the following to the Web.config to maintain the database connection string:

      <?xml version="1.0" encoding="utf-8" ?>
     
    <configuration>
        <appSettings>
        <add key="ConnectionString" value="Data Source=.;Initial
    Catalog=Northwind;User Id=sa"
     />
        </appSettings>
      <system.web>
    .
    .
    .

    More ASP.NET Articles
    More By Jagadish Chaterjee


       · why wouldn't you use a tableadapter?or the MS Enterprise Library?
       · ofcourse, I would have used. But, I didn't mean to use enterprise library in this...
     

    ASP.NET ARTICLES

    - 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
    - Developing a Dice Game Using ASP.NET Futures...
    - Completing an ASP.NET AJAX Server-Centric Ba...
    - Information Management for an ASP.NET AJAX S...
    - Comment and Order Management for an ASP.NET ...
    - Back-end Management Tasks for an ASP.NET AJA...
    - User Information Management for an ASP.NET A...
    - Adding Comments and Search to an ASP.NET AJA...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway