473,396 Members | 1,998 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

datarows and session state

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
Nov 19 '05 #1
2 1072
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" <ro*****@discussions.microsoft.com> wrote in message
news:AC**********************************@microsof t.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

Nov 19 '05 #2
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 [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" <ro*****@discussions.microsoft.com> wrote in message
news:AC**********************************@microsof t.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


Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: rodchar | last post by:
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...
5
by: Nathan Sokalski | last post by:
I am writing an ASP.NET application in which I need to copy DataRows from one DataTable to another. When I use code such as the following: temprows = nodes.Select("state='PA'")...
5
by: Nathan Sokalski | last post by:
I am writing an ASP.NET application in which I need to copy DataRows from one DataTable to another. When I use code such as the following: temprows = nodes.Select("state='PA'")...
11
by: Glenn | last post by:
Hi I've been experimenting with managing state using the Session object. I've created a simple WS with a couple of methods, one which sets a string value, another that retrieves it. Each...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.