.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
MarieAdela
Imran Ghani
Post New Web Links

Data in session

Posted By:      Posted Date: September 23, 2010    Points: 0   Category :ASP.Net
 

Hi,

I'm trying to work out what to do with some data I have which is used throughout a users session.

I need to hold up to 200 integers for a customer - not all customers will have 200, some may have none at all.

When I look at what this will consume in session, 1Gb of memory would be enough to support 2m users with full allocation. Even with an extremely busy site, say 1000 simultaneous users, memory would not be stretched.

With this in mind the obvious conclusion is to put the data in session, particularly as the tables data is retrieved from may contain 1m records.

The question I have is - is there anything else i need to consider - any hidden gremlins that I need to watch out for, or is it as simple as that?


Thanks


John






View Complete Post


More Related Resource Links

Using Session to pass data between forms

  

In my app, I am displaying an Rss Feed, I have a button that takes the user to another form where they can select a them.  Upon selecting the theme, they are taken back to the original form. 


If the user has selected which theme they want to view then they click on the button to change theme, I need to pass the information about what rss feed they were viewing through session so that once they select the theme they want they are redirected back to the main page and the rss feed they were viewing should still be displayed.


Since I've already bound the data to the xmlDataSource and DataList I am trying the following:


Session.Add("CurrentRssFeed", XmlDataSource1.DataFile);

Session.Add("CurrentDataList", DataList1);


I'm not sure I am passing the data over correctly and I'm not sure how to specify it in the page_preinit.


Any ideas???




send data in class object from one page to another using session

  

hello everybody

now i hav stored all data like user name, data fatched from database of that user

and i stored that data and user name such as:

string strUserName="user name"

dataset ds =new dataset();// data of that user

now i wan yo send d whole data from my login page to user profile page

can anybody help me for that...................

and plz tell me that how much is this way is benifitial to send data from one page to another page

plz........kindly waiting for positive rply


Changing aspx page causes session data to be lost...

  

Strange but true. Any ideas what might be causing this?

Mike 


Storing large data in Session State

  
Hi, We have a scenario where we need to store large tables of data on Session in asp.net page. on a highlevel we have to store following data  1> A table (table 1) with 1000 rows and 8 to 10 columns. 2> A table(table 2) with 500 rows and 8 to 10 columns (actually user can add the data from table 1 to table 2, so as user keeps on adding from table 1 we remove the data and put it in table 2) 3> Another table(table 3) with 1000-1200 rows each having 3 columns. We are having a webfarm, so we need to store it in either SateServer of Oracle DB, please advise which one is better. What would be the performance implications of storing such huge data on the server. One more thing is at any point of time max of 70 -80 people will be accessing our website, so will this cause any performance degradation? Thanks in anticipation Harsha

Retriving data from CheckBoxList and passing it to a Session

  

Hy


I wondering how can I retrive data from a CheckBoxList in c#. and once I get the data I would like to store the data in a session so I can use the data from a session on a another page


Thank you in advance


Clearing Session Data from Modeless Popup window.

  

I am using Post method to generate crystal reports. The user requirement is to show the report in a modeless pop up screen. 

The session data needs to be cleared as it may at times contain a very large dataset.  

One implementation I have placed in at present is - placing a button "Close Button". When user clicks close button, I am able to clean up the session content as well as close the window.

The issue I am facing is to get the handle of the modeless window when it is closed using the x button. Also, since the pop up window is modeless, the user might have moved to another screen, henceforth the parent of the popup window is already changed or out of context.

How do we clear the sesssion content when the issue condition arises?

Please provide suggestions.


How can I manage session data outside the ASP.Net session object?

  

I want to be able to persist data across a session but do this outside of the built-in session state object.  Why is a long story that I will not go into here.  I just need to know where I can put data other than in the session object that will persist across the specific session (in memory - I already have a database solotion).

Thanks.


Retrieve data from SQL server based on login username (session data)

  

Hi,

I'm trying to make a dropdown list with data available based on the users login name. Heres what I have as my SQL Query in the SQLDataSource:


SELECT Client_Name, Client_ID FROM Client WHERE (Client_Name LIKE '%@Client_Name%')


So say if the login username is "User1" but the database client name is "User1 Steel" I want the dropdownlist to pull "User1 Steel" as the display and Client_ID as the value from the dropdown list. 


I dont know how to use the session data!


Using session data for SQL query

  

Hi,

How would I go about using my session data (ie username) for an SQL query to populate a dropbox? Here is what I have so far:


SELECT Client_Name, Client_ID FROM Client WHERE (Client_Name LIKE '%@Client_Name%')


Am I on the right track?




Storing session data continuouly

  

Hi,

 

Is it possible to store gridview session data after each postback. I have a gridview and a checkbox within. Each time a user clicks the checkbox, I like to store the gridview ID in a session. After browsing through various pages, I like this session data to continuously store the information up to 20mins?

 

How can I continously store the session variable. Please can someone provide a sample? Say a text box and if I enter 1 click on a hyperlink (where session variable is stored) return back to the page, enter 2 click hyperlink then I should get in the session 12?

Any one know how to do this? Please provide code in VB.

THanks! Nijojo


Losing Session Data with Response.Redirect

  

This is weird. In my newly developed chat application, when I invoke Response.Redirect, I am losing my session data. What is particualrly odd is that this sometimes seems to occur after a slight delay, so I reach the page, and then the session info gets lost momentarily thereafter. Mostly though it seems to get lost immediately. I have of course googled this issue, but yet to find anything that speaks to my problem. SessionState is in InProc mode. Session state has been working fine for me until this unexpected problem, so everything is configured right. So far the only workaround I can think of is to use a link instead of a button, and use javascript to call a server-side function on onclick to do the work I need to do before the link gets invoked. Messy, and I'd rather not go that way unless there's no alternative.

Just to preempt one red herring, I do use Response.Redirect(<address>, false).

The problem occurs both on the testing and production servers. I'm running ASP.NET 3.5 on IIS7.


Is there a way of creating an Ado.Net Entity Data Model filtered on a Session variables (C#)

  

I'm trying to customize correct displaying of dropdownlists so information shown in comboboxes is relevant to the kind of user logged on (maintaining referential integrity at data level)

e.g.: I have a user already logged on and depending on his profile I'd like to display to this user only the portion of the database that he would be allowed to see. That would mean that he might have acces to an specific subset of data, e.g.: businesstype = "3", loging level = "2", etc.

Is there a way of creating an Ado.Net Entity Data Model filtered on a Session variables as to maintain proper referential integrity at data level? So it means that the filtering must apply to all entities contained in the .edmx model at once.


Add a global parameter to your ado.net entity data model which can be used to validate a session var

  

is there a way to add a global parameter to your ado.net entity data model which can be used to validate a session variable ? in that way you could have a general rule to get for instance only the records belonging to a specific user's profile logged in, is that possible?

In case that it were possible doing that way you will be making the rule valid for all entities in your model at once. right? 


Ado.Net Entity Data Model filtered on Session variables ... is that possible?

  

I am currently working on a Dynamic Data 4.0 project with C# and I'm trying to customize correct displaying of dropdownlists so information shown in comboboxes is relevant to the kind of user logged on (maintaining referential integrity at data level)

e.g.: I have a user already logged on and depending on his profile I'd like to display to this user only the portion of the database that he would be allowed to see. That would mean that he might have acces to an specific subset of data, e.g.: businesstype = "3", loging level = "2", etc.

Is there a way of creating an Ado.Net Entity Data Model filtered on a Session variables as to maintain proper referential integrity at data level?


How much data can save in Session ?

  

Hi guys,

I'm developing chat application on asp.net mvc, in my app, user can create room and invite other join to chat, but don't need to save chat room information.

So, I designed to save all chat message ,room information and user info in Session and clear it when owner close the room.

I'm worry about stressing server when I save alot of data (include room info, user info, and message) in Session if there are up to 5000 rooms created and alot of messages transfered in that room.

Is my solution good enough ? is it ok to save in Session ? if it was bad, could you guys tell better solution, please !


"Global" session data

  

I am storing some information in a Session variable. I have a Structure that contains a number of separate items including login data and shopping basket data. At the end of the Page_LoadComplete event I store the structure as follows:?

Current.Session("SessionPool") = Spl

And I retrieve it at the start of the Page_Load event as follows:

Spl = Current.Session("SessionPool")

Throughout my logic I refer to items within the structure such as spl.loginrow (a datarow) and spl.basket (a datatable).

I am testing the (remote) web site from two independent PCs. I change the quantity of items for one line in the shopping basket on one PC then, on the other PC, I refresh the basket and, hey presto, it reflects changes I have made on the first PC.

This suggests to me that the session variable is being shared across all sessions somehow - i.e. it is being managed at an application level. Does this make any sense? Any suggestions about what kind of dumb mistake I could have made here?


Binding WPF Controls to an Entity Data Model

  
In this interview, programming writer, McLean Schofield, demonstrates how to bind WPF controls to an entity data model, using Visual Studio 2010 Beta 1. You can also learn more in the topic: Walkthrough: Binding WPF Controls to an Entity Data Model.
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend