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).ro ws(0)("FirstNam e") = 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).ro ws(0)("FirstNam e") = "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 1 1413
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**@nospamasp y.co.uk> wrote in message
news:u8******** ******@tk2msftn gp13.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).ro ws(0)("FirstNam e") = 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).ro ws(0)("FirstNam e") = "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
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 data for the record I load. So
then I change the contents of one of the textboxes and
click on the Save button. The button's event handler then
calls the data adapter's Update method and I check the
return value. Nada-zilch-nothing. I even put a...
|
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 with some TextBox controls that are bound to a
dataset columns.
I make a modification to one of the TextBox's and click a button.
|
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 datagrid isn't going to work).
On this page, people can update a variet of records. On submit, I want to
then go in and update all of the records.
Normally, I'd make each form element include a runat: server and then
declare it in my codebhind so I...
|
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 one row, all of
them were updated so i immediatelly figured out that i have to include
the id of every entry in the update statement. This is where the
problem is raised. My database is an Access database. The table i am
updating contains a Date...
|
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 access DB
via a datagrid control.
The add and delete functions work great, but the edit does not actually
update the database. I put in some displays and apparently on the first
item in the grid gets set during editing, all others come back empty???
| |
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:
WebForm1.aspx
ChangeValue.aspx
WebUserControl1.ascx
Module1.vb
|
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 two fields: a primary key and another holding a
string. In table B there are three fields: a primary key, a foreign key
(which links to the primary key in A) and other field holding a string.
|
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.
|
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 exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Incorrect syntax...
|
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,...
|
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...
| |
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,...
|
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...
|
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();...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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 we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |