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  
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

The Simplest CRUD Operations for Lookup Tables in ASP.NET
By: Jagadish Chaterjee
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 27
    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

    - More Advanced ASP.NET 3.5 Functions and Subr...
    - ASP.NET 3.5 Functions and Subroutines
    - Coding an IQ Test with Conditionally Driven ...
    - Developing Conditionally Driven Event Handle...
    - ASP.NET 3.5 Debugging Using Visual Web Devel...
    - Understanding Event Handlers in ASP.NET 3.5
    - Building a Web Form in ASP.NET and PHP: a Co...
    - Inserting Data into a Microsoft SQL 2008 Dat...
    - Creating an ASP.NET Dynamic Web Page Using M...
    - Retrieving Data from Microsoft SQL Server 20...
    - Building ASP.NET Web Forms to Use a MySQL Da...
    - Creating an ASP.NET Database using MS SQL 20...
    - Building an ASP.NET Website Using Include Ta...
    - Create ASP.NET Web Forms to Use a Microsoft ...
    - Editing Web Design Layout in Visual Web Deve...





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