datarows and session state

G

Guest

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
 
A

Alvin Bruney [MVP - ASP.NET]

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
 
G

Guest

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



Alvin Bruney said:
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 said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top