473,505 Members | 14,136 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

db update via web form

I'm using a web form that I am populating from a query (via a
SqlDataReader).
This isn't a datagrid or other similar control, its simply a series of
TextBox controls on a page. Most of the examples I have seen thus far have
been dealing with using datagrids, etc. and how asp.net can help you deal
with updates in a somewhat automatic fashion. I have what I consider a more
traditional form (which may mean I am doing this wrong) and my db update is
somewhat complicated because depending on which TextBox's text has changed I
need to perform different update logic.

Most of the updates I have seen have happened in the Page_Load event, but
that doesn't seem appropriate here. I know that I can have event handlers
that get called for every text control but those happen after Page_Load.
What I feel I need to do is in Page_Load determine which TextBox controls
have changed, and then perform the appropriate update logic. Any help would
be much appreciated.
Nov 19 '05 #1
2 1006
Hi,
Something has to trigger the postback of the page right? If it is a button,
why not use the click event to test which text box has changed and then
execute the appropriate update. For the update you can use SQL or
OleDbCommands attached to stored procedures.

Ian

"epigram" <no****@spammy.com> wrote in message
news:1117747249.0b2856fd5af18a5b3febf89d7bb21db2@b ubbanews...
I'm using a web form that I am populating from a query (via a
SqlDataReader).
This isn't a datagrid or other similar control, its simply a series of
TextBox controls on a page. Most of the examples I have seen thus far
have
been dealing with using datagrids, etc. and how asp.net can help you deal
with updates in a somewhat automatic fashion. I have what I consider a
more
traditional form (which may mean I am doing this wrong) and my db update
is
somewhat complicated because depending on which TextBox's text has changed
I
need to perform different update logic.

Most of the updates I have seen have happened in the Page_Load event, but
that doesn't seem appropriate here. I know that I can have event handlers
that get called for every text control but those happen after Page_Load.
What I feel I need to do is in Page_Load determine which TextBox controls
have changed, and then perform the appropriate update logic. Any help
would
be much appreciated.

Nov 19 '05 #2
Yes a postback will occur because of a button being pressed. The part
(which I am sure is ridiculously simple) is how to tell if a given control
has changed without caching it's original value in a dataset, session
variable, etc. Maybe that is exactly what you do. Maybe you use the
ViewState somehow. I just don't know. In the examples I have been viewing
you know that a control has changed by an on change even for the control
being called.

Thanks!
"Ian Kelly" <in**@thetawave.on.ca> wrote in message
news:ON**************@TK2MSFTNGP10.phx.gbl...
Hi,
Something has to trigger the postback of the page right? If it is a
button, why not use the click event to test which text box has changed and
then execute the appropriate update. For the update you can use SQL or
OleDbCommands attached to stored procedures.

Ian

"epigram" <no****@spammy.com> wrote in message
news:1117747249.0b2856fd5af18a5b3febf89d7bb21db2@b ubbanews...
I'm using a web form that I am populating from a query (via a
SqlDataReader).
This isn't a datagrid or other similar control, its simply a series of
TextBox controls on a page. Most of the examples I have seen thus far
have
been dealing with using datagrids, etc. and how asp.net can help you deal
with updates in a somewhat automatic fashion. I have what I consider a
more
traditional form (which may mean I am doing this wrong) and my db update
is
somewhat complicated because depending on which TextBox's text has
changed I
need to perform different update logic.

Most of the updates I have seen have happened in the Page_Load event, but
that doesn't seem appropriate here. I know that I can have event
handlers
that get called for every text control but those happen after Page_Load.
What I feel I need to do is in Page_Load determine which TextBox controls
have changed, and then perform the appropriate update logic. Any help
would
be much appreciated.


Nov 19 '05 #3

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

Similar topics

1
1602
by: Jaunty Edward | last post by:
HI, I have to write secure update record php script, here are the complete details of the website, the website has a login system that authenticates the user, writes the session ID for username...
3
1460
by: DK | last post by:
Please can somebody help me ? I have forms named Form 1, Form 2 etc. having fields CustomerName,CustomerAddress,..... Id like to have button on each form ,which will open another form named...
3
1485
by: vonclausowitz | last post by:
Hi Everyone, Is it possible to create some code which can automatically update my forms formatting? I have a small database with a form which is periodically changed. When the db is returned to...
1
266
by: Martin Williams | last post by:
I have a main form with a bound combobox. I then have another form which is accessed from the main form, which I used to update the data that is bound to the combobox. I know how to update a...
9
1256
by: HankC | last post by:
I have a vb.net app that serves our four campuses. A student logs in to start the app. Based on their login domain, I wish display the campus color and image on the form. I cannot find any...
3
11069
by: Brian | last post by:
I have a form that has a textbox used to search records in a table. On the form I have a listbox which shows each record in the table. When you click on each row in the listbox the rest of the form...
2
2836
by: devine | last post by:
Hi All, I am trying to send an automatic email when an update has been made. My update statement will updates 6 fields, and dependant on one of the fields, I would like to send an email using CDO....
9
3321
by: mtgrizzly52 | last post by:
Hi all, I've looked for an answer for this in lots of books, online in several discussion groups and have not found the answer which I feel may be very simple. What I want to do is have a...
1
2458
by: mdk7 | last post by:
I am very new to developing forms and queries with Access. The task that I am required to complete is as follows: Build a form based user interface that displays various information from the...
2
2964
by: C_Kubie | last post by:
I have a populater listbox and I update the contents by running a different SQL statement via listbx.Rowsource ="<SQL statement>" The contents of the listbox changes but the form doesn't. ...
0
7098
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
7367
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...
1
7018
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
7471
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5613
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,...
1
5028
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...
0
3187
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1528
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
754
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.