Results 1 to 3 of 3

Thread: MVC issue - passing back a dataset

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2002
    Location
    Boston
    Posts
    26

    MVC issue - passing back a dataset

    Hi All,

    I'm kinda of stuck. I'm designing an MVC framework. I'm trying to pass back a dataset back to a dataview, but I having a hell of a time trying to figure out how to do this. Don't know why?

    I'm able to create the dataset it's just that I can't pass it back to the Dataview. Keep in mind that this is generic Model.

    Thanks in advanced

    Here is what I have in the Model Object:

    Code:
    Option Strict On
    Imports DSA
    Friend Class ModelData
    
        Private _ds As DataSet
        Private _DataInfo As New DataTable("tablename")
    
        Public Sub New()
    
            Try
                Dim oRequest As New DSARequest
                Dim oParam As New DSARequest.Parameter
                Dim oFactory As DSAAbstractFactory
                Dim oDataSet As DSADataSet
    
                oFactory = New DSASqlFactory
    
                With oRequest
                    .Command = "dbo.spr_Accounts"
                    .CommandType = CommandType.StoredProcedure
                    'oParam.ParamName = 
                    'oParam.ParamValue = 
                    '.Parameters.Add(oParam)
                    .Role = DSARequest.UserRole.Admin
                    .Transactional = False
                End With
    
                oDataSet = oFactory.ExecuteDataSet(oRequest)
                _ds = oDataSet.ReturnedDataSet
    
    
            Catch ex As Exception
                Exit Sub
            End Try
    
        End Sub
        Public ReadOnly Property DataInfo() As DataTable
            Get
                Return _DataInfo
            End Get
        End Property
    End Class
    Public Class DataInformation
        Private _modelData As ModelData
        Private _infoData As New DataView
        Public Sub New()
            Try
                _modelData = New ModelData
    
                With _infoData
                    .Table = _modelData.DataInfo
                End With
    
            Catch ex As Exception
                Debug.WriteLine(ex.Message)
                Exit Sub
            End Try
            
        End Sub
    
        Public ReadOnly Property infoData() As DataView
            Get
                Return _infoData
            End Get
        End Property
        'Public Function getchildData(ByVal childID As Integer) As ChildData
        '    Return New ChildData(childID, _modelData)
        'End Function
    End Class
    Public Class ChildData
    
    End Class

  2. #2
    Frenzied Member ntg's Avatar
    Join Date
    Sep 2004
    Posts
    1,449
    OK, I'll bite

    What's an MVC framework ?

    Cheers,
    NTG
    "Feel the force...read the source..."
    Utilities: POPFileDebugViewProcess ExplorerWiresharkKeePassUltraVNCPic2Ascii
    .Net tools & open source: DotNetNukelog4NetCLRProfiler
    My open source projects: Thales SimulatorEFT CalculatorSystem Info ReporterVSS2SVNIBAN Functions
    Customer quote: "If the server has a RAID array, why should we bother with backups?"
    Programmer quote: "I never comment my code. Something that is hard to write should be impossible to comprehend."
    Ignorant quote: "I have no respect for universities, as they teach not practicle stuff, and charge money for"

  3. #3
    Fanatic Member
    Join Date
    May 2002
    Posts
    746
    Model View Controller - a design pattern

    Model. A customer object.

    View. UI to display info about the customer.

    Controller. Handles changes to the customer (Model) invoked by the View.

    My understanding anyway. Typically the View and Controller get wrapped together such that the important bit here is seperating the Model from the View/Controller - which is something you probably do all the time w/o realizing it had a name.

    Some MS writing on the subject

    and

    One of the more seminal texts on patterns.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width