Visual Basic.NET
  Home arrow Visual Basic.NET arrow Page 3 - An Introduction to Object Oriented Databas...
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 
Actuate Whitepapers 
Moblin 
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? 
VISUAL BASIC.NET

An Introduction to Object Oriented Database Development with VB.NET 2005
By: Jagadish Chaterjee
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 14
    2006-07-12

    Table of Contents:
  • An Introduction to Object Oriented Database Development with VB.NET 2005
  • Explaining the class
  • Explanation continued
  • Expanding the class to handle errors
  • Further expanding the class to handle additional rows

  • 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

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    An Introduction to Object Oriented Database Development with VB.NET 2005 - Explanation continued


    (Page 3 of 5 )

    The first and most important issue to remember is that a class is simply a template/definition.  A class is very much like a user-defined data type.  A data type cannot hold data by itself.  A variable (which allocates some memory) must have a definition based on a data type to hold some value. The value is stored in the memory allocated by the variable. 

    In very much the same way, a class doesn’t contain any data on its own.  We need to create something like a variable to work with a class, or to access class members. Any variable which is created on the basis of the class is termed an “object” (or “instance”).  Every “object” you create based on a class must be instantiated (or allocated with memory) with the operator “new.” The process of instantiation is simply the calculation of memory to be occupied by “class members” and the allocation of the same. 

    Let us consider the first statement in “btnSearch_click:”

            Dim ep As New Emp

    The above statement creates and instantiates an “object” (or “instance”) named “ep” based on the class “Emp.” Once the object is created/instantiated, we can access all of its members programmatically. Proceeding further, we have the following:

            ep.load(Me.txtEmpno.Text)

    The above statement executes the method “load” available in the object “ep.”  The method “load” accepts a parameter (therefore called a “method with parameters”) to retrieve the information of the “empno” sent to it.  Once the method is executed successfully, all the information of that “empno” is assigned to the “fields” of the class.  We access the fields of object “ep” using the following statements:

            Me.txtDeptno.Text = ep.m_deptno
            Me.txtEname.Text = ep.m_ename
            Me.txtSal.Text = ep.m_sal

    More Visual Basic.NET Articles
    More By Jagadish Chaterjee


       · Hello guys. This series introduces you the OOPS in VB 2005. enjoy
       · I am unable to download the zip file.
       · The link has been corrected. Thank you for pointing out the link and we apologize...
       · Hello jagdish. i wanna to ask you, being a newbie in vb.net 2005, is this the best...
       · Hai,This series explains you the simplest way to develop OOP based db...
     

    VISUAL BASIC.NET ARTICLES

    - Movement and Player Statistics in a VB.NET T...
    - Creating and Drawing a Game Map in VB.NET
    - Working with Classes and Properties for Game...
    - Working with Loops, Arrays, and Collections ...
    - Learning Loops in VB.NET for Game Development
    - Learning VB.NET: Working with Variables, Con...
    - The Basics of VB.NET Through Text Game Devel...
    - Learning VB.NET Through Text Game Development
    - 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...




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