473,387 Members | 1,678 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,387 software developers and data experts.

Simple form postback to update a database

In a .Net Asp application I am able to retrieve data from an Access db and
display in on a web form. How ever during the update function after a page
update, the update command does not throw an exception but it does not save
out the changes either. It seems that upon the postback no data exists in
the dataset. I must be missing something.

How you post the data from an edited user page back to the database?
if (!(Page.IsPostBack))
{
this.oleDbDAUser.Fill(this.dsMain1,"Users");
this.lblUserID.DataBind();
this.txtFirstName.DataBind();
this.txtMiddleName.DataBind();

..........

}

No error here, but no data is saved either:
private void btnSave_Click(object sender, System.EventArgs e)
{
try
{
this.oleDbDAUser.Update(this.dsMain1);
}
catch (Exception oops)
{
this.txtUserMessage.Text = "Error occured!<BR>" + oops.ToString() ;
}

}
}

Thanks,
Ray

--
--

/\_Ray Valenti ____ http://www.quixor.com ______
\/ Quixor Flex Systems, Ltd.
Nov 17 '05 #1
1 1419
You have to save your dataset somewhere between requests.
Check my reply to jason post "Dataset persistence" (I
answered as anonymouns).
-----Original Message-----
In a .Net Asp application I am able to retrieve data from an Access db anddisplay in on a web form. How ever during the update function after a pageupdate, the update command does not throw an exception but it does not saveout the changes either. It seems that upon the postback no data exists inthe dataset. I must be missing something.

How you post the data from an edited user page back to the database?

if (!(Page.IsPostBack))
{
this.oleDbDAUser.Fill(this.dsMain1,"Users");
this.lblUserID.DataBind();
this.txtFirstName.DataBind();
this.txtMiddleName.DataBind();

..........

}

No error here, but no data is saved either:
private void btnSave_Click(object sender, System.EventArgs e){
try
{
this.oleDbDAUser.Update(this.dsMain1);
}
catch (Exception oops)
{
this.txtUserMessage.Text = "Error occured!<BR>" + oops.ToString() ; }

}
}

Thanks,
Ray

--
--

/\_Ray Valenti ____ http://www.quixor.com ______
\/ Quixor Flex Systems, Ltd.
.

Nov 17 '05 #2

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

Similar topics

13
by: Samantha Smit | last post by:
Hi, I am trying to create a simple asp page that has one command button that updates a database. The URL of the page is like this: http://MyServer.com/Update.asp?UserName=Tom My asp code is...
1
by: Robert Muchacki | last post by:
Hello all! I'm fighting with this little problem. I'm trying to retrieve data from a table in SQL Server 2k. I'm dead. The only result I get is retrieving the headers of the columns - no data in...
1
by: Ray Valenti | last post by:
In a .Net Asp application I am able to retrieve data from an Access db and display in on a web form. How ever during the update function after a page update, the update command does not throw an...
2
by: Myk Quayce | last post by:
I have a small .aspx page that uses old style forms with client-side JavaScript validation. Everything works fine until I try to upate the database with some new information. I must be doing...
4
by: ItNerd | last post by:
Someone PLEASE HELP ME!!!!! All I want to do is a simple postback and grab the value from a textbox on clicking a linkbutton like below, but the value is not writing to the screen. I am...
2
by: sanju | last post by:
hi there i am trying to fire an button event in ascx file which interacts with database ,my problem is " i am calling ascx file wiht a button click dynamically when user needs to update database...
10
by: Krista Lemieux | last post by:
I'm new to ASP.NET and I'm not use to the way things are handled with this technology. I've been told that when I have a control, I should only bind the data to it once, and not on each post back...
2
by: serge calderara | last post by:
Dear all, I have a webform with a calendar control on it. When loaded the calendar is set to the current date. Depending on a criteria from a database field, calendar day cell appears with red...
27
by: one man army | last post by:
Hi All- I am new to PHP. I found FAQTS and the php manual. I am trying this sequence, but getting 'no zip string found:'... PHP Version 4.4.0 $doc = new DomDocument; $res =...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...

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.