Solved

When can't you store DataRows in session state?

Posted on 2003-11-12
8
560 Views
Last Modified: 2012-06-22
Is there any condition when you cant store DataRows in session state?
0
Comment
Question by:student816
8 Comments
 
LVL 12

Accepted Solution

by:
roverm earned 250 total points
ID: 9737948
If you use a datagrid then all rows are stored inside the ViewState.

If you want to store some values then a good practice is to add some hidden textboxes/labels on your form and store the values in them.
0
 

Author Comment

by:student816
ID: 9738551
This is not homework question. These set of questions were asked by an interviewer. I wanted to make sure I nailed the interview.

This is the information I have on this area.

I know for a fact that if the data is serialized we can use the dataset but not datatable or datarow. I just wanted to know if there were other conditions.

If you still feel that the question are not appropriate for this forum, please instruct me on how to delete it.

0
 
LVL 5

Assisted Solution

by:mondayblueboy
mondayblueboy earned 250 total points
ID: 9758333
One thing I know that by default Web Service does not maintain session state (it requires setting in the client or hacking outside of the SOAP standard). One example, when a client creates an instance of a Web service and modifies a member variable of the object with one method call, then attempts to read the value from another method call, the value will be the default value for that variable, not the new value.

Please refer to this link for more info
Using ASP.NET Session State in a Web Service
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnservice/html/service08062002.asp

And another thing is that only DataSet and DataTable objects are truly serializable, not DataRow (Please refer to this link,
Standalone DataRow isn't Serializable - http://weblogs.asp.net/mnissen/posts/24072.aspx). However Web services return XML, not objects. Some .NET types can be serialized to XML, but not successfully reconstructed on the client end. The DataSet is an example of a .NET object that can make the transition and DataRow is an example that cannot.

Please refer to this link for more info
Data Types Supported by XML Web Services Created Using ASP.NET
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpcondatatypessupportedbywebservices.asp

Hope this is make sense and answer you question.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 10239786
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Split: roverm {http:#9737948} & mondayblueboy {http:#9758333}

Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

TheLearnedOne
EE Cleanup Volunteer
0
 
LVL 12

Expert Comment

by:roverm
ID: 10241600
Agreed
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now