ASP.NET
  Home arrow ASP.NET arrow Page 3 - Object-Oriented Report Development using C...
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

Object-Oriented Report Development using Crystal Reports and ASP.NET 2.0
By: Jagadish Chaterjee
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 13
    2007-08-20

    Table of Contents:
  • Object-Oriented Report Development using Crystal Reports and ASP.NET 2.0
  • The DBHelper class for interacting with the database
  • Developing classes to hold information from the database
  • Adding a Factory class to populate object collection

  • 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


    Object-Oriented Report Development using Crystal Reports and ASP.NET 2.0 - Developing classes to hold information from the database


    (Page 3 of 4 )

    Information from the database must be contained in an object. Using the "Solution Explorer," add a new class named "Order.vb".  This class is used to hold the information based on the fields selected.

    The code for the "Order" class is as follows:

    Imports Microsoft.VisualBasic

     

    Public Class Order

      Private _OrderID As Int32

      Private _CustomerName As String

      Private _EmployeeName As String

      Private _OrderDate As Date

      Private _OrderValue As Double

     

      Public Property OrderID() As Int32

        Get

          Return _OrderID

        End Get

        Set(ByVal value As Int32)

          _OrderID = value

        End Set

      End Property

     

      Public Property CustomerName() As String

        Get

          Return _CustomerName

        End Get

        Set(ByVal value As String)

          _CustomerName = value

        End Set

      End Property

     

      Public Property EmployeeName() As String

        Get

          Return _EmployeeName

        End Get

        Set(ByVal value As String)

          _EmployeeName = value

        End Set

      End Property

     

      Public Property OrderDate() As Date

        Get

          Return _OrderDate

        End Get

        Set(ByVal value As Date)

          _OrderDate = value

        End Set

      End Property

     

      Public Property OrderValue() As Double

        Get

          Return _OrderValue

        End Get

        Set(ByVal value As Double)

          _OrderValue = value

        End Set

      End Property

     

      Public Sub New(ByVal oID As String, ByVal oCustomer As String, ByVal oEmployee As String, ByVal oOrderDate As String, ByVal oOrderValue As String)

        Me.OrderID = oID

        Me.CustomerName = oCustomer

        Me.EmployeeName = oEmployee

        Me.OrderDate = oOrderDate

        Me.OrderValue = oOrderValue

      End Sub

    End Class

     

    Add one more class (OrderCollection.vb), which holds a set of objects (collection) based on the above class. The code for the class is as follows:

    Imports Microsoft.VisualBasic

    Imports System.Collections.Generic

     

    Public Class OrderCollection

      Inherits List(Of Order)

     

    End Class

    You need not write any code for the above class as it deals with generics in .NET 2.0.

    More ASP.NET Articles
    More By Jagadish Chaterjee


       · Hello guys,This is my next contribution on the series of "Programming Crystal...
     

    ASP.NET ARTICLES

    - 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
    - Developing a Dice Game Using ASP.NET Futures...





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