Optimization - Why Should Or Shouldn't Store A Dataset - Datatable As A Session Variable In Page

Feb 25, 2010

I am working on a web application that is consuming a Dataset returned by a web service. As the application is running I store that Dataset as a session variable to be used over and over again as the user navigates to the different pages that will edit the tables within the dataset. The idea was the user will only have to wait for the data once when the application loads then the application would use the session variable until the user saves the changes they made, when that happens it would pass the edited tables to the service to update the database. Is there problems with this design and the storage of the Dataset and Datatables as a session variable?

View 4 Replies


Similar Messages:

Forms Data Controls :: Store Gridview Datatable In Session And Then Retrieve From Session And Store Database

Nov 11, 2010

Its related to datatable in gridview store in session and then session retrive and store to database. basically i am using gridview here creating new row for button click and these row adding untill user's last entry then submit all these entry to database. so i want to use session variable to store this data temporarily and after final entry user click on submit button and all data shold be save in db.

View 9 Replies

Web Forms :: Session Variable Is Null When It Shouldn´t Be Null?

Mar 18, 2010

I have a problem with a SessionVariable. I will explain what is happening:

1. From the default.aspx I send Session["LoginByAdmin"] = "Dummy"; and then redirect to this page where I have the code below. So the Page_Load sees that this Session["LoginByAdmin"] != null and enter this page. This works fine !

2. In the Page_Load, I later fill a ListBox1 with foldernames.

3. With Button1_Click1, I will now delete the choosen Folder in the ListBox1 wich works fine the first time and the ListBox updates the new existing folders in the ListBox. (I have wrapped this inside an updatepanel)

The problems comes now when I try to delete a choosen folder in the ListBox1 the second time in a row. When I select a Folder in the ListBox1 and now Press Button1, I will be redirected to "Default.aspx". This meens that this code is running: (That meens that Session["LoginByAdmin"] == null and I have not set this to null anywhere. This is my big question how this variable can be = null here?

if (Session["LoginByAdmin"] == null)
Response.Redirect("Default.aspx");
break;

[Code]....

View 5 Replies

How To Store A Value Into A Session Variable And Load From That Value Back From The Session Variable

Nov 22, 2010

Currently in an .aspx file, I am storing a value (filename that was created in that session) in an hidden text box. When the user clicks on the "Print" labeled Hyperlink control, it opens the file that was stored in the hidden text box control. But when the user goes to different screen (in the same session), I loose the filename value that is stored in the hidden text box control. So I would like to store the filename variable in a session variable. So that if the user leaves this .aspx file and comes back to this .aspx file I can load the value into the hidden text box from the session variable.

View 11 Replies

State Management :: Public Variable Vs Session Variable To Store Logged In UserID

May 17, 2010

I have a web application which uses a session variable to store the logged in userid. If no user is logged in, of course this variable will be empty and the contents displayed on my website are meant for guests. If there is a user logged in, the user specific controls/access/links will then be a displayed.

I am now having issues with my hosting where on shared application pool, the worker recycle is triggered every 90 minutes, this will clear sessions causing all my users to be logged out. I opted for a dedicated application pool, which got worse because I am only allocated 50MB memory limit and if this is reached, the worker recycle is triggered and I lose my sessions again. I have tried as much as possible optimization techniques, e.g. dispose where possible, close connections, disable viewstate for static controls etc but my memory per instance keeps building up from page to page without any signs of improvement. I don't use loops nor store huge objects like bitmaps etc but my sessions are now gone even faster than 90 minutes in shared application pool before.

I have considered using SQL Session State but there isn't a simple guide on using this with MySQL. I am getting desperate and considering using a public variable, a string as a replacement to store logged in user id instead of in a session variable. I am pretty sure this will solve my issue with sessions being recycled but are there any negative consequences of doing this? One problem I can think of is if the user closes the browser, the system will never know that the user is now logged out and this public variable should be nothing. In this scenario, will the GC eventually clear this abandoned public variable.

View 10 Replies

DataSource Controls :: Is Datatable Data Store In Dataset

Apr 24, 2010

is datable data store in asp.net dataset.. ?

View 1 Replies

DataSource Controls :: Does Dataset Store All Its Datatables' Records Into Memory If I Just Call One Datatable From It

Apr 2, 2010

Does dataset store all its datatables' records into server memory if I just call one datatable from it?Lets make an example, a dataset with three datatables - tbCompany, tbCompanyStaffs, tbSalesOrderwhere tbCompany is the parent of tbCompanyStaffs. tbSalesOrder is an independant table.Does dataset load all tbCompanyStaffs records into the server memory as well when a class retrive data from tbCompany?

View 3 Replies

Checking For Session Variable As DataTable?

Jan 27, 2010

I've got a DataTable that I'm appling to a session variable on inital page_load.

I need to check whether that Session Variable when the page is returned to - ie Not isPostback.

I can do If Session("var") = Nothing Then, but the problem with that is, if the Session variable already has the DataTable applied to it, it will throw back an error stating that
Operator '=' is not defined for type 'DataTable' and 'Nothing'.

How can I get around this?

View 4 Replies

How To Store The Value In Label2 Row 8 In A Session Variable

Mar 11, 2010

I have a datalist that shows Label, Label2 and has 8 rows of data.

I would like to store the value in Label2 row 8 in a session variable... how can i do this in VB.net?

View 7 Replies

Assign Array Session Variable To Dataset?

Mar 12, 2010

How to assign a array string session to dataset or datatable? I have a array session data in that i stored n number of values. i want to assign these values to dataset. so that i can bind these values to gridview. so anyone pls let me know how to do this? Iam getting error to convert sesion{"noncontractitem"] to datatable.

string[] sessiondata = { txtProductNo.Text, txtItemDescription.Text, ddlUnitOfMeasure.Text, ddlDistributor.Text, rbtlItemType.Text, txtQnty.Text, txtPacking.Text, txtUnitCost.Text };
Session["NoncontractItem"] = sessiondata;
DataTable dts = new DataTable();
dts = (DataTable)Session["NoncontractItem"];
grdSelectedItems.DataSource = dts;
grdSelectedItems.DataBind();

View 2 Replies

C# - Store Multiple Values In A Session Variable?

Jan 9, 2011

consider this scenario: a user on my website has a profileID. There are some pluginID's associated with this profileID.

E.g.: User1 might have 2, 3 and 5 plugins associated with his profile.

When the user logs in, I store the profileID of the user in a session variable cod. ON a certain page, the user tries to edit the plugins associated with his profile. So, on that page, I have to retrieve those pluginID's from the DB.

I have applied this code but this fetches only the maximum pluginID from the DB and not all the pluginID's.

[Code]....

I was trying to figure out how can I store multiple pluginID's in this session variable?

View 2 Replies

VS 2008 - Saving And Loading Datatable From A Session Variable?

Mar 25, 2011

I need to save data in a datatable on a web page where the user is adding items to order. I know how to create a datatable and add data to it. And I will be binding it to a gridview control. But I do not want to loose the data when the page does a postback. Do I need to save it to a session variable for this? Or will the data stay in the datatable?

I found this code posted online. Is this how I would save it to a session variable and then load it anytime?

Code:
Dim dt As New DataTable()
Session("MyDataTable") = dt
' To retrieve it from session
Dim dt As DataTable = DirectCast(Session("MyDataTable"), DataTable)

View 1 Replies

State Management :: Storing Datatable In Session Variable?

Oct 28, 2010

I am storing Datatable in Session variable in my project. Is it good practise to do so? The datatable has 20 fields and can run into 1000+ records. Will it hamper my application performance?

View 11 Replies

Pitfall Of Storing DataTable(10,000 Rows) In A Session Variable?

Feb 24, 2010

Consider my dataTable contains 10,000 rows and i want to know the pitfall of storing datatable in a session variable... I want to use it until a new row has been added...What type of session mode should i use?

View 4 Replies

State Management :: Store 2 Arrays In One Session Variable

Apr 21, 2010

I have 2 arrays declared like this :

[Code]....

and i wish to put both in one session variable and then retrieve it to get one array like:

{"intItemID","strCategory","strType"}

View 3 Replies

State Management :: Store An ArrayList Into A Session Variable?

Apr 23, 2010

I'm looking store an ArrayList into a session variable, but am having a few problems. Can you spot anything wrong?

public partial class _Default : System.Web.UI.Page { ArrayList score = new ArrayList(); protected void twist2(object sender, EventArgs e) { int a = 11; int c = RandomNumber(a); score.Add(c); score = (ArrayList)Session["scoreData"]; Result.Text = (c).ToString(); String Result_id = Result.Text; int total = 0; //Session["scoreData"] = score; for (int i = 0; i < score.Count; ++i) { total += (int)score[i]; } Sum.Text = (total).ToString(); String Sum_id = Sum.Text; }

View 3 Replies

Vb.net - Get Selected Value Of Dropdown List And Store In Session Variable?

May 15, 2010

Dim ename As String = DropDownList.SelectedItem.Value

this statement is'nt working

View 1 Replies

Data Controls :: How To Store Session Variable In Database

Jul 23, 2013

i want to store  Session["Name"] into databse "name" column. how to do this ?

View 1 Replies

Vb.net - Retrieve Selected Value From Dropdown List And Store In Session Variable?

May 15, 2010

the dropdown list is showing data from database, but how to retrieve the selected value and store it in a session variable??

View 1 Replies

State Management :: Store And Retrieve Multiple Values In A Single Session Variable?

Aug 24, 2010

I want to store employee name,designation and department in session variable and retrieve in another page how to do this.

View 2 Replies

Data Controls :: How To Store Data From Database In Session Variable

Nov 19, 2013

i have store data in the session and i want to insert that data to the database using sql server 2008.can i do this or not? if can, how can i?

View 1 Replies

Web Forms :: Store And Insert Variable Into Page?

Dec 19, 2010

I wish to store some variables across my whole ASP.NET site, such as the site name/title and a multitude of others.

I wish to store them in an XML file with a name and value, and then insert them into the relevant place on the page using a tag like <% siteTitle %>.

How can I do this? I have seen similar with sites like SmarterMail and other ASP.NET off-the-shelf products, but they seem to use a value from their own DLL file, this is probably too much of a complex method, so I will need something simple like the XML method mentioned above. Having said this, I don't particularly want to use the AppSettings method.

View 2 Replies

How To Store Store Procedure Results In A Dataset When There Are 3 Sql Datasets Returned

Mar 11, 2011

My SQL stored procedure returns 3 different datasets as follows:

team_id name
1 Team1
2 Team2
...and more

location_id name
1 Dallas
2 New York
...and more

branch_id name
1 Austin
2 New Jersey
...and more

How do I put this data into one Dataset so that I can loop through the data and manipulate it?

View 1 Replies

State Management :: Variable To Store Temporary Page Data?

Sep 29, 2010

I'm working on a web page that is going to be used to enter data into a database. The page is going to be dynamic in that the user has the ability to add a row to the table with the same fields, ie lname1, fname1, mi1 then lname2, fname2, mi2

I'm wanting to use a variable to keep track of how many lines there are so that when I generate the added line I am creating a new field with the ID of lname+# . Whats the best way to do this, a global variable, session variable? As side note, first time programming in .Net or C#.

View 3 Replies

How To Copy Data From Datatable To Dataset.datatable

Oct 31, 2010

how to copy data from datatable to table in dataset i ry this but its readonly property

ds.datatable1=newdt.copy

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved