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

Updating databound textboxes immediately after a database change????


Hi all

I'm new to C# and ADO.Net. I've managed to insert, update and delete records
from a database but I need to know how to show these changes immediately.
For example : If I delete a record from the database, that deleted record
will remain in my forms textboxes until I restart the program. Is there a
way to remove that record straight away after deleting it from the database??

I expect it is something very simple but I'm not getting it.

Any help will be appreciated?

Jon
--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...sharp/200507/1
Nov 17 '05 #1
2 2030

In short, no. Remember that the data in any bound control is a copy of data
that was extracted from the database at the time the control was bound to
the data. You need to rebind the control to the data if you want a refresh
to take place.

Perhaps set up a timer that polls the database to keep your text boxes up to
date? The catch is if you have users editing these text boxes, then they may
get reset to the data in the database half way through the user typing in
new text.

In general, bind data to your controls on the form's load event, each time
the dialog is displayed.
"Jon S via DotNetMonster.com" <fo***@DotNetMonster.com> wrote in message
news:51***********@DotNetMonster.com...

Hi all

I'm new to C# and ADO.Net. I've managed to insert, update and delete
records
from a database but I need to know how to show these changes immediately.
For example : If I delete a record from the database, that deleted record
will remain in my forms textboxes until I restart the program. Is there a
way to remove that record straight away after deleting it from the
database??

I expect it is something very simple but I'm not getting it.

Any help will be appreciated?

Jon
--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...sharp/200507/1

Nov 17 '05 #2

Hi Dan

Thanks for that.

Kind regards
Jon.
Dan Bass wrote:
In short, no. Remember that the data in any bound control is a copy of data
that was extracted from the database at the time the control was bound to
the data. You need to rebind the control to the data if you want a refresh
to take place.

Perhaps set up a timer that polls the database to keep your text boxes up to
date? The catch is if you have users editing these text boxes, then they may
get reset to the data in the database half way through the user typing in
new text.

In general, bind data to your controls on the form's load event, each time
the dialog is displayed.
Hi all

[quoted text clipped - 11 lines]

Jon

--
Message posted via http://www.dotnetmonster.com
Nov 17 '05 #3

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: Coco | last post by:
Hi, who knows how to update the 'child' textboxes in a datarelated situation if the child records "doesn't yet exitsts/are still empty"? The problem can be explained with the Northwind database....
5
by: maurban | last post by:
Hi there experts, I have a gridview with a couple textboxes and a dropdownlist. I'm trying to insert a default value into my database driven dropdownlist. I'm doing this in the rowdatabound...
0
by: jimmarq | last post by:
I have a form with textboxes that are databound to objects named "Person." When the user enters the form for the first time, if there is no object in the binding list, an object is created and...
2
by: =?Utf-8?B?VmFuZXNzYQ==?= | last post by:
Hi All! I am with a situation where I am not getting the right updating to the form's fields. The situation is the following one: I have one combobox and one textbox. I am using the...
0
by: Mike | last post by:
So here's the situation (.NET 2.0 btw): I have a form, and on this form is a textbox among many other databound controls. The textbox is bound to a field in a data table via the Text property. ...
1
by: cerilocke | last post by:
I have a repeater in which I have a hidden field (input type = hidden), a textbox (asp:TextBox), a checkbox (input type = checkbox) and a label (asp:Label). I have bound all four items to the same...
1
by: Wavey | last post by:
Hi All, I have a problem with updating an Access database from a datatable. I have two rows of data in my database at the moment for testing, the first row is an ID number (primary key), the...
5
by: nzkks | last post by:
Hi I am using these: ASP.Net 2.0, VB.Net, Visual Studio 2005, SQL Server 2005, Formview controls In a ASP.Net form I have 20 textboxes and 20 dropdownlists(ddl). All ddl(s) are databound and get...
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: 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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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.