473,396 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Transaction using data from multiple Web Forms ?

I have multiple web forms in my application. The user after logging on is
directed to form1 where he enters information desired. Once finished he is
directed to form2 and the same procedure goes on till form6. After user has
entered information in all 6 forms the information needs to be entered in the
database by performing a Transaction. If the data from any of the forms is
missing the Transaction is rolled back.

My query is where do i store the data from first five forms till i commit
the transaction?

Right now I am using a dataset, which I instatiated in form 1. As the user
is direcetd to form2 the data entered is stored in table1 which is added to
dataset, which in turn is stored in cache. In subsequent forms I add new
Tables to same Dataset and after finishing all the forms I am using the same
dataset to update the Database by carrying out a transaction in DataAdapters
UpdateCommand Object.

Is this the way I shall perform the transaction? Pls Guide. Pls specify the
correct methodology if I am doing it wrong.

--
Thank You.

Saket Mundra
Nov 19 '05 #1
3 2073
J
Whether you switch between 6 different pages or use a panel control and keep
submitting 1 page in a wizard fashion is entirely up to you, store in your
datasets, store in session or use viewstate the important thing to get is
your validation correct so that it is physically impossible for users to
miss out fields or enter invalid data and then when you come to perform your
update, spawn a transaction and commit if successful else rollback if
failure.
Personally I like the tabbed approach using panels, yes there is a great
deal more going on in the page than anyone looking at it would think but
there is far less processing in the background as everything is still there
for you come the end ready to submit; circumstance, preference and any other
number of factors might sway your decision, one last comment though, I'd
tighten up your validation so that they simply can't submit the form
correctly if they miss critical fields, if it is not going to go into the
database because it is going to fail(rollback) what is the point of allowing
them to submit the form anyway?

regards,
J.

"Saket Mundra" <Sa*********@discussions.microsoft.com> wrote in message
news:3E**********************************@microsof t.com...
I have multiple web forms in my application. The user after logging on is
directed to form1 where he enters information desired. Once finished he is
directed to form2 and the same procedure goes on till form6. After user
has
entered information in all 6 forms the information needs to be entered in
the
database by performing a Transaction. If the data from any of the forms is
missing the Transaction is rolled back.

My query is where do i store the data from first five forms till i commit
the transaction?

Right now I am using a dataset, which I instatiated in form 1. As the user
is direcetd to form2 the data entered is stored in table1 which is added
to
dataset, which in turn is stored in cache. In subsequent forms I add new
Tables to same Dataset and after finishing all the forms I am using the
same
dataset to update the Database by carrying out a transaction in
DataAdapters
UpdateCommand Object.

Is this the way I shall perform the transaction? Pls Guide. Pls specify
the
correct methodology if I am doing it wrong.

--
Thank You.

Saket Mundra

Nov 19 '05 #2
Thanx for the response J.

I understand your stress on performing validation properly and I'll surely
try my best at it. Even, I was toying with the idea of using some sort of
tabs on my form, but i couldn't find any Tab controls. And i have no clue how
to go about creating one.

I would appreciate if you could explain it to me. Thanx for your help.
"J" wrote:
Whether you switch between 6 different pages or use a panel control and keep
submitting 1 page in a wizard fashion is entirely up to you, store in your
datasets, store in session or use viewstate the important thing to get is
your validation correct so that it is physically impossible for users to
miss out fields or enter invalid data and then when you come to perform your
update, spawn a transaction and commit if successful else rollback if
failure.
Personally I like the tabbed approach using panels, yes there is a great
deal more going on in the page than anyone looking at it would think but
there is far less processing in the background as everything is still there
for you come the end ready to submit; circumstance, preference and any other
number of factors might sway your decision, one last comment though, I'd
tighten up your validation so that they simply can't submit the form
correctly if they miss critical fields, if it is not going to go into the
database because it is going to fail(rollback) what is the point of allowing
them to submit the form anyway?

regards,
J.

"Saket Mundra" <Sa*********@discussions.microsoft.com> wrote in message
news:3E**********************************@microsof t.com...
I have multiple web forms in my application. The user after logging on is
directed to form1 where he enters information desired. Once finished he is
directed to form2 and the same procedure goes on till form6. After user
has
entered information in all 6 forms the information needs to be entered in
the
database by performing a Transaction. If the data from any of the forms is
missing the Transaction is rolled back.

My query is where do i store the data from first five forms till i commit
the transaction?

Right now I am using a dataset, which I instatiated in form 1. As the user
is direcetd to form2 the data entered is stored in table1 which is added
to
dataset, which in turn is stored in cache. In subsequent forms I add new
Tables to same Dataset and after finishing all the forms I am using the
same
dataset to update the Database by carrying out a transaction in
DataAdapters
UpdateCommand Object.

Is this the way I shall perform the transaction? Pls Guide. Pls specify
the
correct methodology if I am doing it wrong.

--
Thank You.

Saket Mundra


Nov 19 '05 #3
J
Paste this into a webforms aspx file (WebForm1.aspx);

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb"
Inherits="panels.WebForm1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>WebForm1</TITLE>
<META content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<META content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
<META content="JavaScript" name="vs_defaultClientScript">
<META content="http://schemas.microsoft.com/intellisense/ie5"
name="vs_targetSchema">
</HEAD>
<BODY>
<FORM id="Form1" method="post" runat="server">
<TABLE width="300" border="0">
<TR>
<TD>
<ASP:PANEL id="pnlTab1" runat="server" width="250px" height="250px"
backcolor="Green" visible="False">
<ASP:TEXTBOX id="txt1" runat="server"></ASP:TEXTBOX>
<ASP:TEXTBOX id="txt2" runat="server"></ASP:TEXTBOX>
</ASP:PANEL>
<ASP:PANEL id="pnlTab2" runat="server" width="250px" height="250px"
backcolor="Red">
<ASP:TEXTBOX id="txt3" runat="server"></ASP:TEXTBOX>
<ASP:TEXTBOX id="txt4" runat="server"></ASP:TEXTBOX>
</ASP:PANEL>
</TD>
</TR>
<TR>
<TD>
<ASP:BUTTON id="btnSwitch" runat="server" text="Switch"></ASP:BUTTON>
</TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>

and paste this into the code behind aspx.vb file;

Private Sub btnSwitch_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnSwitch.Click

If (pnlTab1.Visible = True) Then
pnlTab1.Visible = False
pnlTab2.Visible = True
Else
pnlTab1.Visible = True
pnlTab2.Visible = False
End If

End Sub

each panel control contains two text boxes but you could put anything in
them, tables, ddls, datagrids, anything really and you can also have as many
as you want, just initially make only one visible.

You'll notice that only the red panel is visible initially, click the switch
button to move between the red and green panels. Panel controls are rendered
as DIV tags, before asp.net came along you could make these anyway,
understand that you are going to be posting back when switching between
however many panels you need, you'll notice though that values entered
between clicks remain in viewstate so you lose no data. You could write
client side code that could switch between the divs but you'll need to
evaluate your situation re connection speeds, user requirements, etc, etc...
before being forced down that road....

J.
Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: noah | last post by:
Does PHP have a feature to associate Cookie sessions with a persistent database connection that will allow a single transaction across multiple HTTP requests? Here is how I imagine my process: I...
3
by: Alan | last post by:
Gidday people, I had a bit of a problem this morning. I think I've got it sorted now, but I wonder if anyone can shed some light. I have a plain VBS WHS file that instantiates a component that...
0
by: Manoj Sharma | last post by:
I am performance testing some batch processing engines. These are written in ..NET and SQL Server and are typically concerned with generating XML files out of data retrieved from the database. I...
5
by: Klemens | last post by:
I get SQL30090 reason 18 by trying to do an insert in a federated table and an update in a local table in one transaction Do I have to change some settings to get done or ist this not possible by...
19
by: davidgordon | last post by:
Hi, I need some pointers/help on how to do the following if it possible: In my access db, I have the following: Tables: Products, Sub-Assembly, Product-Pack Table, Products
2
by: Frankie | last post by:
In a C# Windows Forms application, using the SqlClient data provider... I have methodA() and methodB(). methodA starts a transaction on its own command and conection objects, does bunch of...
2
by: msnews.microsoft.com | last post by:
Hello, I have the scenario. I m building an application either in asp.net or window application. This application is base on n-tier application model. Let us take example of Northwind Database in...
9
by: Andy_Khosravi | last post by:
I'm an entry-level VBA programmer that is almost entirely self-taught. This means that while I have adequate knowledge of VBA in some areas, I have several gaps in others that may seem obvious to...
19
by: Gregor =?UTF-8?B?S292YcSN?= | last post by:
Hi! I'm using DB2 database on one server and ORACLE database on the second one. I want to move some data from ORACLE database to DB2 database and update some columns on ORACLE database so I know...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.