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

Updating dataset with values from TextBox control

Hi
I have built a very simple page, which takes data via TextBox controls, and
updates to a Dataset.

I've used the Data Access Blocks (v2), to help with functionality, and to
build a DAL.

Part of my code takes the form:

ds.tables(0).rows(0)("FirstName") = Firstname.Text
There is only one record in the dataset, so this updates the record with the
value the user entered in the TextBox.
However, it doesn't.....

When I debug, the value of Firstname.Text is the value it was when the page
opened, and not the value that is Currently in it.

I have changed the code to :

ds.tables(0).rows(0)("FirstName") = "Test Value"

And this gets wrote out successfully.

It appears that my textbox does not update its value, when the user changes
its value.
Seems strange.... Am I doing something wrong?

Thanks
Paul
Nov 17 '05 #1
1 1381
Paul,

I think your text box is overwriting itself when the page posts back. If you
are setting a value in the text box when the page is loaded up you need to
do that only the first time the page is loaded.

use:

If Not IsPostBack Then
'---Set you text box here.
End If

This will keep the text box's data from being overwritten on post back.

Sincerely,

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
"Paul Aspinall" <pa**@nospamaspy.co.uk> wrote in message
news:u8**************@tk2msftngp13.phx.gbl...
Hi
I have built a very simple page, which takes data via TextBox controls, and updates to a Dataset.

I've used the Data Access Blocks (v2), to help with functionality, and to
build a DAL.

Part of my code takes the form:

ds.tables(0).rows(0)("FirstName") = Firstname.Text
There is only one record in the dataset, so this updates the record with the value the user entered in the TextBox.
However, it doesn't.....

When I debug, the value of Firstname.Text is the value it was when the page opened, and not the value that is Currently in it.

I have changed the code to :

ds.tables(0).rows(0)("FirstName") = "Test Value"

And this gets wrote out successfully.

It appears that my textbox does not update its value, when the user changes its value.
Seems strange.... Am I doing something wrong?

Thanks
Paul

Nov 17 '05 #2

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

Similar topics

1
by: sandman | last post by:
I've got a simple windows form with some bound textboxes and Save button. Each texbox is bound to column in a table in an Access database. The form fills fine - all the fields show the correct...
0
by: Dave Dodd | last post by:
Hi All, I am new to dotnet and so far I am really enjoy using it. I am trying to figure out if the dataset is supposed to be updated when IsPostBack is true. For instance, I have a page...
4
by: Darrel | last post by:
I'm creating a table that contains multiple records pulled out of the database. I'm building the table myself and passing it to the page since the table needs to be fairly customized (ie, a...
5
by: junglist | last post by:
Hi guys, I've been trying to implement an editable datagrid and i have been succesful up to the point where i can update my datagrid row by row. However what used to happen was that once i updated...
1
by: jason | last post by:
The guts of the below asp.net vb code was pieced together from another thread - all due credit to it's original author. Thank you! I've modified it to maintain a small local Microsoft 2000...
10
by: sqlboy2000 | last post by:
Hello all, I have something very simple going on here and I'm scratching my head as to what the problem is. There are 4 items in my project, 2 webforms, a user control, and a module: ...
4
by: Geoff | last post by:
Hi I'm hoping somebody can help me with the following problem that has occurred to me. Suppose I have two tables in an SQL Server database. Let's call these tables A and B. Assume that A has...
1
by: Patricio | last post by:
Hello all I have a form that contains several textbox. I have also a DataSet that contains the Fill function by ID. How can I assign the DataSet values into my TextBox? Thanks a lot.
3
by: Trez | last post by:
Hey guys, Am new at using ASP.Net. am having some problems updating my SQL DB. whenever i try i get this Error. Can someone help me? Incorrect syntax near 'nvarchar'. Description: An unhandled...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.