Temporarirly storing web form data to be inserted into Database ?

G

Guest

I have a web application with two forms. After user enters data in first form
he is directed to the second form. After Filling the second form as he clicks
on save button, the data entered is stored in the database using a
Transaction Object, That inserts data, entered by user in both the forms, in
the database.

My problem is where shall i store the data entered by the user in the first
form when he is redirected to next form and till i perform the transaction?
 
B

Brock Allen

The question is can your users deal with the potential for the loss od data
from page 1 to page 2? If not, then store the data in the database inbetween
the pages, in a temp save table, perhaps. If they can deal with the possibility
of loss of data, then Session state is an acceptable place to store state
across pages.
 
G

Guest

Thank you for the replies.
I understand that the data can be stored in Session variables or temporary
tables.

However, say if i have more then 6 forms in which the user enters the data
one by one and after entering the data on last form he saves it. At this
point in time i am saving the data in the database through a transaction.

So, now the question arises is it advisable to create so many temporary
tables or Session variables for each form before the transaction takes place.

The most important point is the user cannot afford to lose data between forms.
Please Help.

Saket Mundra
 
B

Brock Allen

The most important point is the user cannot afford to lose data
between forms. Please Help.

Then you've just answered it -- you must save it between forms. Then once
the user is done with all the forms, then move all the data to your "real"
tables within your transaction.
 
G

Guest

Thanx again for your reply Brock.

I got your point and thuis is what I have been doing. Its just that i am
looking for something more comprehensive. And moreover, i want to get away
with writing all the code required to save the data in temporary tables and
then in real Database.

Also I am quite unsure about the memory this technique will consume, Is
there no other way to do so but to create temporary tables for each of the
forms.

Thank you.

Saket
 
J

Joseph Byrns

The tables idea is the most robust. It should take no extra storage doing
it this way as in your transaction you would move the data from the
temporary tables to the permanent tables, so no space lost.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,019
Latest member
RoxannaSta

Latest Threads

Top