Ask a Question related to ASP.NET General, Design and Development.
-
Paul Aspinall #1
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
Paul Aspinall Guest
-
updating dataset component with actionscript
I'm trying to update text from the fields of a dataset object. I can easily reference and change using _root.dataset.currentItem.FieldName. But... -
updating dataset from xml file
Hello, I am new in developing with Dataset, XML, Web Services ... I want to load a xml file into a dataset and update the database with new and... -
sending values in textbox
Hi I want to be able to send the vlaues that a user enters in a couple of input fields. However, my register_globals is set to off. So how do I... -
VERY STRANGE BUG? Adding a textbox control causes other textbox control to fail???
I've had this happen a few times too. I'm still not positive of what exactly causes it but all that's happening is the control that no longer... -
updating a typed dataset (newbie question?)
I created a DataGrid and bound a DataView of a typed DataSet to it (i tried with the DataSet as well but i'd rather use the DataView as i'm using it... -
S. Justin Gengo #2
Re: Updating dataset with values from TextBox control
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:
[url]www.aboutfortunate.com[/url]
"Out of chaos comes order."
Nietzche
"Paul Aspinall" <paul@nospamaspy.co.uk> wrote in message
news:u8jq4P4XDHA.3248@tk2msftngp13.phx.gbl...and> Hi
> I have built a very simple page, which takes data via TextBox controls,the> 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 withpage> 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 thechanges> 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> its value.
> Seems strange.... Am I doing something wrong?
>
> Thanks
>
>
> Paul
>
>
S. Justin Gengo Guest



Reply With Quote

