Visual Basic.NET
  Home arrow Visual Basic.NET arrow A Wrapper Class for DML Statements Using V...
Iron Speed
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 
Download TestComplete 
Windows Web Hosting
 
IBM® developerWorks 
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? 
VISUAL BASIC.NET

A Wrapper Class for DML Statements Using Visual Basic.NET
By: Jagadish Chaterjee
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 11
    2006-08-16

    Table of Contents:
  • A Wrapper Class for DML Statements Using Visual Basic.NET
  • The beginning of the class
  • Adding a column to the INSERT or UPDATE command
  • Adding code to add binary data for INSERT command
  • Adding code to add binary data for UPDATE command
  • Executing the DML command
  • Completing the class

  • 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
     
     
    Iron Speed
     
    ADVERTISEMENT

    Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!

    A Wrapper Class for DML Statements Using Visual Basic.NET
    (Page 1 of 7 )

    This article explains several techniques for working with DML statements in a flexible manner, without worrying much about the syntactical errors.
    A downloadable file for this article is available here.

    The entire source code for this article is available in the form of downloadable zip.  The solution was developed using Microsoft Visual Studio 2003 Enterprise Architect with Microsoft SQL Server 2005 Developer Edition on Microsoft Windows Server 2003 Enterprise Edition.  Even though I believe that the source code available with this contribution can work with Microsoft Visual Studio.NET 2002, I didn't really test it in any other environment. I request that you post in the discussion area if you have any problems with execution.

    What exactly is this DML support class doing?

    In several applications, we use DML statements which execute dynamically. If we are working with an INSERT statement that has too many columns, it would be rather daunting. The same would be true for an UPDATE statement with many columns.

    To solve all these issues, I developed a simple wrapper class specifically to work with DML statements flexibly. As part of what was needed, I declared the following enumerations:

    PublicEnum CommandType
            Insert
            Update
        End Enum
    PublicEnum DataType
            NumericType
            CharacterType
            DateType
    EndEnum

    When we work with a DML statement, it would be generally an INSERT, UPDATE or DELETE (putting SELECT aside). DELETE is very simple and I simply don't want to handle it in this class. That is why I declared only "Insert" and "Update" as part of the "Command Type."

    When working with DML commands, the syntax will be different based on the data types. To support different data types, I declared the above enumeration.

    To execute the DML command, I am using the Data Helper class developed by me in my previous articles. If you want to include your own code, I request that you  go ahead by forgetting the data helper code. You can also modify this class with respect to Microsoft Data Access Blocks.

    More Visual Basic.NET Articles
    More By Jagadish Chaterjee


       · Hai guys! enjoy the DML wrapper included in this contribution.
     

    VISUAL BASIC.NET ARTICLES

    - Types of Operators in Visual Basic
    - Operators
    - Understanding Custom Events using Visual Bas...
    - Polymorphism using Abstract Classes in Visua...
    - Shadowing using Shadows in Visual Basic.NET ...
    - Overloading and Overriding in Visual Basic.N...
    - More on Controlling Windows Fax Services Usi...
    - Programmatically Controlling Windows Fax Ser...
    - Focusing on Forms and Menus in Visual Basic
    - Manipulating Forms with the Windows Forms Li...
    - Basics of the Windows Forms Library
    - Forms, Controls, and Other Useful Objects
    - Implementing OOP to Develop Database Oriente...
    - Using Themes and Skins for Personalization w...
    - A Deeper Look at Personalization using Visua...

     
    Accelerating Trading Partner Performance
     
    Competing on Analytics
     
    Cost Effective Scaling with Virtualization and Coyote Point Systems
     
    Five Checkpoints to Implementing IP Telephony
     
    Hosted Email Security: Staying Ahead of New Threats
     




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