Looking For Best Way To Handle Data Persistence

Apr 2, 2010

I am writing a site with six pages that use the same 12 pieces of data for x number of people. The user always goes to a fixed page where I do all of the DB related work to get the 12 pieces of data for x number of people. However, I don't want to do the DB related work again as it is overhead intensive. So after the initial page I end up with something like this:

Person1, Data1, Data2,Data3,.......Data12
Person2, Data1, Data2, Data3........Data12
[code]...

I have been trying to figure out the best way to store the data so that I can use the data set throughout the remaining 5 pages. I thought of setting up an array within a class but I keep getting a null value when I try to access that class values (maybe I have it set up wrong). I thought using a session variable to store the array, but because it is multi dimensional I am having issues (again, most likely due to a lack of knowledge). I thought perhaps storing the array into a temp SQL table would be efficient, because then it would be a single read out to SQL to get the datatable containing the data back into the page, but that seems like a lot of work for something that should be easier.

View 5 Replies


Similar Messages:

Web Forms :: Finding Generic Tutorial On Persistence Data Access Layers?

Mar 26, 2010

where I can find a good generic tutorial on persistence data access layers?

View 2 Replies

How To Use Persistence To Maintain State / Relationship

Nov 29, 2010

I have to create a very simple database driven website ( for a project ) with basic features like a login system, etc. I have completed most of the basic tasks required, but there is one section that is asking me to 'Use persistence to maintain state/relationship'.

I have read a few articles and videos about persistence but I don't understand its benefits and why and how it should be used. Can anyone point me towards a site that explains how to implement state persistence in a simple way. I don't need anything advanced just a very simple way of integrating this into a very simple site to say its been done.

View 1 Replies

Choosing Persistence Engine - Criterion And Projection?

Jan 24, 2011

I touched on this last year sometime, but I was frustrated at the time and might not have made much sense. I'd like to try again to see if I can get some constructive advice. I am having an issue in choosing a persistence engine. My first choice is FluentNHibernate / NHibernate. However, I am having severe difficulties with their criterion and projection mechanisms. Searching for examples is difficult and when I do find something, I really don't understand what I'm looking at. After a year of trying to bring this together, it still eludes me. I know I could just ask here for help with certain things, but you guys have more things to do than sit and teach me nhibernate criterion. My second choice is Entity Framework 4. I am leaving the CTP 5 off the list for now as there is a major bug in how self-referencing tables are handled at the moment. Now, I have two sub-choices here. The first involves using code first by turning off code generation in the designer and place my enities and edmx in separate libraries (.Domain and .Persistence.Mapping) but this involves a bit of extra work. Then again, for simplicities sake, I could just dump the edmx designer right in the domain library. But this means having the mapping info in the domain library. Not ideal, but it'd work. I still retain the ability to map collections, references and properties as protected or private, and add logic-checking accessors to the entities, as well as setting a protected and public constructor. The entities would still be strong, valid business entities. With these points in mind, what direction should I head?

View 11 Replies

Security :: Losing Persistence Using Forms Authentication?

Feb 13, 2011

I have had a website on a shared web hosting plan for over a year with no issues with keeping persistence. It's been prettys stable, and the only drawback of the host I am using is that it's very slow on occasion...sometimes taking 5-10 seconds to load a page.

So over the last few weeks, I went searching for another web host and and testing one out now.So while my existing website is still running the old web host, I copied the code and data and pushed it on the new web host. It's up and running, but I noticed that shortly after I log in (Forms Authentication), I am logged off within 20-30 seconds.I decided to add the machineKey to the web.config, and it seems to have fixed it.

My question is why would this have fixed it? I asked if the host's servers were in a web farm.

View 5 Replies

Dynamic - Dynamically Loading Controls And Persistence?

Sep 1, 2010

I am loading a series of controls in the Page_Load event. However, I have to recreate those controls each page load, which means storing their data elsewhere. This is cumbersome.

protected void Page_Load(object sender, EventArgs e)
{
MyControl control = (MyControl)LoadControl(...);
control.Initialize(GlobalClass.controlData);
//^gives the control the data it had previously.
//Or use ViewState["controlData"] if serializable.
Controls.Add(control);
}

I feel like I should be using if (!IsPostBack) {}, but I don't know how, or why. In contrast, if I place the controls into the markup, then the controls seem to stay persistent. For example, a button in mark-up will remember any changes to its Text property (I think?).

<asp:Button ID="buttonText" runat="server"
Text="Text Segment" onclick="buttonText_Click" />

How do I maintain some sort of persistence with dynamically added controls, like controls added via mark-up? This would save me much work and frustration.

(I've coded for a small eternity, but the more I do ASP.NET, the more confused I become. Which is exactly the opposite of what how I understood learning to work :-P.)

View 2 Replies

Web Forms :: User Controls With HTML Elements And Persistence?

Jan 4, 2010

I have created a Web User Control (e.g, uc.ascx) which has a few HTML checkboxes in it (using Input Checkbox).

As uc.ascx is dynamically created in my webform page (e.g. page1.aspx), I discovered that the HTML checkboxes did not persist their "Checked" status. how I can make these HTML checkboxes persist?

View 1 Replies

State Management :: Stopping ViewState Persistence On Dynamic Controls?

Oct 15, 2010

I have a set of dynamically-created (IE: by code) controls on my web page. Depending on which options the user decides to go (Edit/New), those controls are re-created with the appropriate information (IE: "with values" with Edit, "without values" with New).

Here's the situation:

- I create my controls in InitComplete when it comes to save the data (both on Edit/New) contained within the controls.

- I create my controls in PreLoad when it comes to load them initially (Both on Edit/New) in order to avoid the ViewState to kick in.

However, despite creating the controls after the ViewState has been applied (technically), the controls still somehow retain the pre-postback's information. IE: if I have options 2 and 4 selected and I choose "New", which should show the options without being selected, they remain selected no matter what. And this is true despite changing their values in the PreLoad state. From my understanding, creating a control in this fashion and at that point in the page lifecycle should override any values the ViewState might have had for those controls. I have also tried to disable the parent's control viewstate (Table.EnableViewState = false) again, to no avail.

I've tried using the Me.ViewState.clear() and Me.ClearChildViewSate prior to loading the initial values as well, but again all for naught. I do understand that any control created after the Init phase of the lifecycle has to play "catchup" with the current state, however I would expect that clearing the ViewState prior to creating the controls would fix this issue. It doesn't seem to.

View 1 Replies

Forms Data Controls :: How To Handle Empty Values When Binding Data

Jul 21, 2010

I have a grid which is binding to a objectdatasource and when it is in edit mode, i am displaying a form template and wanted to bind all the values. I have one field called ApprovedCode. In the edit mode, i am displaying all the codes drop down list box and making a bind on the selectedvalue and i dont know how to handle when it is empty. When it is empty i wanted to display "Select..."

I followed this forum post but i am getting error

[URL]

This is my code

[Code]....

This is the error message that i am receiving

"ddlApprCode' has a selectedvalue which is invalid because it does not exist in the list of items

View 2 Replies

Modern Way To Handle And Validate POST-data In MVC 2?

May 4, 2010

There are a lot of articles devoted to working with data in MVC, and nothing about MVC 2.So my question is: what is the proper way to handle POST-query and validate it.Assume we have 2 actions. Both of them operates over the same entity, but each action has its own separated set of object properties that should be bound in automatic manner. For example:

Action "A" should bind only "Name" property of object, taken from POST-request
Action "B" should bind only "Date" property of object, taken from POST-request

As far as I understand - we cannot use Bind attribute in this case.So - what are the best practices in MVC2 to handle POST-data and probably validate it?UPD:After Actions performed - additional logic will be applied to the objects so they become valid and ready to store in persistent layer. For action "A" - it will be setting up Date to current date.

View 2 Replies

How To Handle Large Volume Of Data In Gridview

Mar 19, 2010

I have large volume of records in my database(70k).How do i handle with this kind of volume data in gridview. Is there any samples provided for this?

View 2 Replies

How To Handle Concurrency Control In Dynamic Data

Jun 1, 2010

I've been quite impressed with dynamic data and how easy and quick it is to get a simple site up and running. I'm planning on using it for a simple internal HR admin site for registering people's skills/degrees/etc.

I've been watching the intro videos at www.asp.net/dynamicdata and one thing they never mention is how to handle concurrency control.

It seems that DD does not handle it right out of the box (unless there is some setting I haven't seen) as I manually generated a change conflict exception and the app failed without any user friendly message.

Anybody know if DD handles it out of the box? Or do you have to somehow build it into the site?

View 5 Replies

Sql Server 2008 - Handle Data Concurrency?

Mar 25, 2010

I have an application, that is accessing by number of users at the same time. Those users, who are accessing the application getting the same id. Here what i am doing in the code is, when they are creating new user i am getting a max id from DB and increasing the value to 1. So that they are getting same ID. so that i am facing concurrency in this situation. How to solve this problem. I need to display different numbers when the users click on NewUser. I am using SQL server 2008 and .NET 3.5 and C#.NET

View 2 Replies

SQL Server :: Best Way To Handle Constantly Updating Data?

Sep 27, 2010

I'm building a browers-based game that will need to constantly be updating EVERYONE'S accounts regularly; what is the best way to go about doing this? Creating a process that runs every time someone goes to a page on my site slows down the load time immensely. Do I need to create a windows scheduled task that calls this/these process(es)? It will need to constantly run.

View 2 Replies

Looking For Good Method To Handle Data Invalidation Or Timeout?

May 10, 2010

I understand the need for a function like DB_Get_Cached("sql string") that hashes the SQL in order to perform a lookup in memcached for the existence of the data.

function DB_Get_Cached(string SQL)
data = memcache_get_data(md5(SQL))
if (!data)
return DB_Get(SQL)
end if
end function


What is a good method to expand this to handle data invalidation or timeout?

I'm thinking in terms of product pages in an e-commerce site, or user details in their profile.

View 2 Replies

Architecture :: How To Handle Multiple Users Changing Same Data

Mar 24, 2010

I have a form which allows users to modify data, what's the best way to handle that so if two or more users try to make an update i get the data in there properly without overriding the new stuff. for example if name and bday are in the form, user1 changes name but not bday, same time user2 accesses the form, the original name and bday are there, user1 saves, but when user2 saves, since he had the original name value the original is saved over the first.

View 9 Replies

Forms Data Controls :: Try To Handle The ItemInserting Event

Nov 28, 2010

When you try to handle the ItemInserting event, the e.Values collection is empty. How do you add your fields to this collection manually?

View 1 Replies

Forms Data Controls :: Handle The State Of The Gridview

Aug 6, 2010

I have two gridviews that are in within UpdatePanels each, which are dynamically filled with data and a checkbox column. Clicking on one checkox one of them (Checkbox AutoPostBack = true) , the checkbox column of the other disappears, How to I can handle the state of the gridview.

this is my code:

[code]....

View 3 Replies

Forms Data Controls :: How To Handle Two Buttons In A Datagrid

Jan 22, 2011

I have a datagrid where i use template columns. In the EditItemtemplate of a column i display a Link button.Now I have one more button which is a EDIT button in the normal EditcommandcolumnI am trying to use Itemcommand to handle the buttonclick in the EditItemTemplate and the normal ONEDIT for the Edit button.Now the problem is, since Itemcommand event considers the post back of even this Editbutton it get fired before the datagrid goes to editmode.So can some one help me with the eventhandling code that will recognize which Buttonclick firest the Itemcommand even of a datagridTo make it very simple, Short and sweet. HOW DO I HANDLE TWO DIFFERENT BUTTON CLICK IN A ITEMCOMMAND EVENT OF A DATAGRID?

View 1 Replies

Forms Data Controls :: How To Handle Null Rows

Jun 18, 2010

I have a query that averages data in 15 minute increments that I display in a chart using Microsoft Chart Controls. Everything works fine except when there is no data for a 15 minute increment. How do I get the chart to show just the empty time slot?

Query:

[Code]....

View 4 Replies

ADO.NET :: Handle Errors In Data Access Layer Code?

Feb 28, 2011

I am learning on how to create data access layer code for a web site. I want to ensure I am actually connecting to the datasource, so, I am wanting to use a try/catch block within my data access layer class methods. What I am not sure how to handle is a case where the connectionstate is not open. The method should ideally return a datatable. If an error is thrown would I just return an empty datatable? That is my first thought. My other thought is to return an object and pass a datatable if the connection succeeds or the exception if the connection fails.

View 10 Replies

Forms Data Controls :: Handle Multiple DataKeyNames?

Mar 17, 2010

I have these line of code:

[Code]....
When i debug i get an error that says: 'System.Data.DataRowView' does not contain a property with the name 'job_id'and sometimes 'System.Data.DataRowView' does not contain a property with the name 'pub_id'I need to get the appropriate value for the selected row. GridView only output Jobs results or Publishers results, the problem is when the user clicks select button beside the record, i get the error i mentioned above.

View 3 Replies

Forms Data Controls :: Handle GridView Row Deleting In Code Behind?

Feb 1, 2011

I modified a GridView control to enable alphabetical paging, and in doing so had to bind the GridView manually in the code behind rather than using the ObjectDataSource I had used originally.

Now my "delete" command in the GridView isn't working. I get that I need to handle this in the code behind now that I'm no longer bound to the ObjectDataSource.

But I'm not sure how to do that in C# and am not finding any examples.

Here's my .aspx:

[Code]....

And the .cs:

[Code]....

View 5 Replies

Forms Data Controls :: How To Handle Null Values In While Loop

Apr 16, 2010

i am unable to handle null values in while .even i tried to handle condition is breaking and coming null value comming inside loop.

[code]....

View 3 Replies

Finding New Data Access Best Practices / How To Handle Data Access, And Data Manipulation And Display

Dec 15, 2010

I've been out of the ASP.Net arena since 1.1, and I'm starting to get back into it after a hiatus.

In the past, I would generally create SqlDataReaders, wire them up to pull from tables in a database via direct sql or accessing database views (mostly in MSSQL), grab the data, and display it in some datatable, or datalist.

Modifying data would usually be calling a stored procedure in the database to add/modify data, and then retrieve it afterward.

Now that I read up, I see there are alot of new things in ADO.Net world; strongly typed datasets, auto-generated adapters, etc.

My question is, does anyone have a good reference on best practices (or a book recommendation) on how to handle data access, and data manipulation and display now? I'm assuming that there are more automatic ways to show and manipulate data than before, but the new details are quite vast (which is good), but slightly overwhelming for me.

View 1 Replies







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