Public Function GetAllVisitorTypes() As DataSet ' Get a reference to the data access object Dim dao As mmDataAccessBase = Me.GetDataAccessObject() ' Create and configure parameter objects 'Dim param1 As IDbDataParameter = dao.CreateParameter("@CustomerID", custID) 'Dim param2 As IDbDataParameter = dao.CreateParameter("@EmployeeID", employeeID) ' Get a DataSet filled with the result set 'Return Me.GetDataSet("SELECT * FROM Orders WHERE CustomerID = @CustomerID AND " + ' "EmployeeID = @EmployeeID", param1, param2) Dim dsVisitorTypes As DataSet = _ Me.GetDataSet( _ "SELECT * FROM VisitorTypes") Return dsVisitorTypes End FunctionThe WinForm code is as follows:
Imports System.Data Imports OakLeaf.MM.Main.Business Imports OakLeaf.MM.Main.Windows.Forms Imports TSG.StellarVisiTrak.Business Public Class VisitorTypeForm Inherits OakLeaf.MM.Main.Windows.Forms.mmBusinessForm ' Declare class variables to use for busness objects and datasets Private oVisitorType As VisitorType Private dsVisitorType As VisitorTypeDataset #Region " Windows Form Designer generated code " Public Sub New() MyBase.New() 'Instantiate and register business objects with the form Me.oVisitorType = CType(Me.RegisterPrimaryBizObj(New VisitorType), VisitorType) 'Me.oParticipantCheckDetail = CType(Me.RegisterBizObj(New ParticipantCheckDetail), ParticipantCheckDetail) ' Register ParticipantCheckDetail as a child of ProcessingBatch 'oProcessingBatch.RegisterChildBizObj(oParticipantCheckDetail, "ParticipantCheckDetail") 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call ' Retrieve all Visitor Types Me.oVisitorType.GetAllVisitorTypes() End Sub ........