473,503 Members | 1,720 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(object sender, System.EventArgs e)
{
if (! IsPostBack)
{
sqlSelectCommand1.Parameters["@ID"].Value = Request.QueryString["id"];
sqlDataAdapter1.Fill(dataSet11);
TextBox1.DataBind();
....
}
private void Update_Click(object sender, System.EventArgs e)
{
sqlDataAdapter1.Update(dataSet11);
}

Nov 17 '05 #1
2 1081
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(object sender, System.EventArgs e)
{
if (! IsPostBack)
{
sqlSelectCommand1.Parameters["@ID"].Value = Request.QueryString["id"];
sqlDataAdapter1.Fill(dataSet11);
TextBox1.DataBind();
...
}
private void Update_Click(object sender, System.EventArgs e)
{
sqlDataAdapter1.Update(dataSet11);
}

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(object sender, System.EventArgs e)
{
if (! IsPostBack)
{
sqlSelectCommand1.Parameters["@ID"].Value = Request.QueryString["id"];
sqlDataAdapter1.Fill(dataSet11);
TextBox1.DataBind();
...
}
private void Update_Click(object sender, System.EventArgs e)
{
sqlDataAdapter1.Update(dataSet11);
}

Nov 17 '05 #3

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

Similar topics

2
10541
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...
3
3255
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...
0
2763
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...
2
5243
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...
5
3030
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...
1
8483
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...
5
2586
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
2835
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....
2
19554
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...
2
2611
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...
0
7192
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
7064
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
7261
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,...
0
7445
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
4665
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...
0
3158
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
3147
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1492
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 ...
0
369
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.