|
-
Oct 21st, 2004, 08:21 AM
#1
Thread Starter
Junior Member
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
-
Oct 24th, 2004, 02:12 PM
#2
OK, I'll bite
What's an MVC framework ?
Cheers,
NTG
-
Oct 28th, 2004, 11:43 AM
#3
Fanatic Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|