473,654 Members | 3,038 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Update web form

CJ
Have problem updating a web form.
Unfortunely when i edit one of the feilds and press the button, it loads the
old data back without any change !! I be happy if some one help me fix this
update problem.Thanks

I use the wizard for generating sqlconnection, sqladapter and dataset.
AutoPostBack is set to true for all fileds
EnableViewState is set to true for all fileds

Here is some code:

private void Page_Load(objec t sender, System.EventArg s e)
{
if (! IsPostBack)
{
sqlSelectComman d1.Parameters["@ID"].Value = Request.QuerySt ring["id"];
sqlDataAdapter1 .Fill(dataSet11 );
TextBox1.DataBi nd();
....
}
private void Update_Click(ob ject sender, System.EventArg s e)
{
sqlDataAdapter1 .Update(dataSet 11);
}

Nov 17 '05 #1
2 1087
CJ
I think the problem is the state(viewstate or session) of the form.

"CJ" wrote:
Have problem updating a web form.
Unfortunely when i edit one of the feilds and press the button, it loads the
old data back without any change !! I be happy if some one help me fix this
update problem.Thanks

I use the wizard for generating sqlconnection, sqladapter and dataset.
AutoPostBack is set to true for all fileds
EnableViewState is set to true for all fileds

Here is some code:

private void Page_Load(objec t sender, System.EventArg s e)
{
if (! IsPostBack)
{
sqlSelectComman d1.Parameters["@ID"].Value = Request.QuerySt ring["id"];
sqlDataAdapter1 .Fill(dataSet11 );
TextBox1.DataBi nd();
...
}
private void Update_Click(ob ject sender, System.EventArg s e)
{
sqlDataAdapter1 .Update(dataSet 11);
}

Nov 17 '05 #2
CJ
I wish a had this example http://www.developerfusion.co.uk/show/3801/6/, but
for a WEB FORM, not a grid......

"CJ" wrote:
I think the problem is the state(viewstate or session) of the form.

"CJ" wrote:
Have problem updating a web form.
Unfortunely when i edit one of the feilds and press the button, it loads the
old data back without any change !! I be happy if some one help me fix this
update problem.Thanks

I use the wizard for generating sqlconnection, sqladapter and dataset.
AutoPostBack is set to true for all fileds
EnableViewState is set to true for all fileds

Here is some code:

private void Page_Load(objec t sender, System.EventArg s e)
{
if (! IsPostBack)
{
sqlSelectComman d1.Parameters["@ID"].Value = Request.QuerySt ring["id"];
sqlDataAdapter1 .Fill(dataSet11 );
TextBox1.DataBi nd();
...
}
private void Update_Click(ob ject sender, System.EventArg s e)
{
sqlDataAdapter1 .Update(dataSet 11);
}

Nov 17 '05 #3

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

Similar topics

2
10548
by: Mark | last post by:
A beginner in this area, I have been able to read a record from a MySQL database and populate an HTML form (wow!). Now, my goal is to allow the user to edit the contents of the form and then update the record in MySQL. The problem is, as soon as the "Update" button (type="submit") is pressed, all of the data disappear from the form. How can that be prevented? Here is my code:
3
3263
by: laurie | last post by:
Hi all, I'm trying to help out a friend who has inherited a client with a PHP shopping cart application. Neither of us know PHP, but I've been muddling my way through, trying to get these old scripts working on a new server with the most recent version of PHP. I've pretty much taken care of all the various errors that were popping up. Most only pointed out out non-fatal undefined or assumed variables. I've been able to cure most of...
0
2773
by: Sue Adams | last post by:
I actually have two issues/questions: I have an autonumber field in an access db table that I grab and later use to update a record in another table withing the same db. The code I use to get it from the db table is: ''Retrieve the Registration Identification Number strRegisterID = Rs("Register_ID") Prior to testing my code and actually updating the db, I''m trying to write it to the page to make sure their isn''t a loop or massive...
2
5263
by: Niyazi | last post by:
Hi, I have not understand the problem. Before all the coding with few application everything worked perfectly. Now I am developing Cheque Writing application and when the cheque is clear the user have to open a form and entera date so we know in report that the desiered check has been cleared. It takes me while to wrtie. But when I try to update the datagrid changes via dataset to MS Access 2003 I get an error that simply says...
5
3038
by: Alastair Anderson | last post by:
I have created a very simple form with which I would like to update a single value in a single row of a database as a proof of concept. The relevant parts of the form are a DBWebTextBox (which is hooked into a column ORGANISATION.SHORT_NAME) and a Button which I am using as a submit button.
1
8499
by: Mark Reed | last post by:
Hi All, I'm having a problem with the following code. I've read quite a lot of old posts regarding the issue but none seem to affer a solution. The scenario is. I have a bound form which contains a couple of memo fields. I need to keep some sort of log as to when each update of the memo field occurs so I have locked bot the memo fields on the main form. To edit them, the user double clicks the ememo field which then opens an unbound...
5
2593
by: Stephen Plotnick | last post by:
I'm very new to VB.NET 2003 Here is what I have accomplished: MainSelectForm - Selects an item In a public class I pass a DataViewRow to ItemInformation1 Form ItemInformation2 Form
2
2840
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. Once the update is made, I am trying to re-query the database to retrieve all the fields that need to be included in the email, but it's just not working for me!! This my code to update <% Set Conn = Server.CreateObject("ADODB.Connection")...
2
19589
by: Brett | last post by:
My database has 2 tables: Table1 & Table2. If a field is not null on a record in table2, then the not null fields in table1 that correspond to the records in table1 needs to be updated to match the field in table2. What I have is a form that is linked to Table2. If the users want to change a field in the main database (table1), they fill the change in to the form (which is linked to table2) If there is no change to the field, they simply...
2
2629
by: sirdavethebrave | last post by:
Hi guys - I have written a form, and a stored procedure to update the said form. It really is as simple as that. A user can go into the form, update some fields and hit the update button to update the information which is stored in a SQL database. In testing we noticed that the form was updating correctly but the update mechanism was also updating the first record of the table in the sql database every time. No error messages are on...
0
8294
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8816
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8494
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8596
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7309
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5627
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4150
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4297
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1924
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.