when i save the following object in session and on postback bring it back
mRow is Nothing and mFirstName and mLastName have values.
Public Class Employee
Dim oDt As DsNorthwind.EmployeesDataTable
Dim oEmployeeDataHelper As EmployeeDataHelper
Dim _dr As DsNorthwind.EmployeesRow
Public Sub New(ByVal dt As DsNorthwind.EmployeesDataTable)
oDt = dt
oEmployeeDataHelper = New EmployeeDataHelper
End Sub
Public Property mFirstName() As String
Get
Return _dr.FirstName
End Get
Set(ByVal value As String)
_dr.FirstName = value
End Set
End Property
Public Property mLastName() As String
Get
Return _dr.LastName
End Get
Set(ByVal value As String)
_dr.LastName = value
End Set
End Property
Public Property mRow() As DsNorthwind.EmployeesRow
Get
Return _dr
End Get
Set(ByVal Value As DsNorthwind.EmployeesRow)
_dr = Value
End Set
End Property
Public Sub RetrieveAllEmployees()
oEmployeeDataHelper.RetrieveAllEmployees(oDt)
End Sub
Public Sub RetrieveEmployee(ByVal id As Integer)
_dr = oDt.NewEmployeesRow
oEmployeeDataHelper.RetrieveSingleEmployee(id, _dr)
End Sub
End Class
[quoted text, click to view] "Alvin Bruney [MVP - ASP.NET]" wrote:
> From the code outline you posted, i don't see how your test case could show
> that the datarow would be null. Why don't you post a sample piece of code to
> demonstrate the issue. For a short but complete program, look here
>
http://www.yoda.arachsys.com/csharp/complete.html
>
> --
> Regards,
> Alvin Bruney - ASP.NET MVP
>
> [Shameless Author Plug]
> The Microsoft Office Web Components Black Book with .NET
> Now available @
www.lulu.com/owc > "rodchar" <rodchar@discussions.microsoft.com> wrote in message
> news:AC561CA4-905B-4110-9559-84A3B7AF38EA@microsoft.com...
> > hey all,
> >
> > i have 2 scenarios to run by you.
> > public class test
> > dim _entireRow as dataRow
> > public property mEntireRow as DataRow
> > 'get and set _entireRow
> > public property mOneField as String
> > 'get and set _entireRow.Field
> > end class
> >
> > it seems to me in testing that if i save an object in session state that
> > contain these properties the mEntireRow returns Nothing however mOneField
> > is
> > saved. This doesn't make any sense to because both properties are based on
> > the same member row.
> >
> > thanks,
> > rodchar
>
>