473,908 Members | 7,236 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Update bound windows control

I have a windows form that is bound to a datatable. In VB6
I could just update the field contents and it would be
updated in the database, however if I update the text
property of the control from code it is 50% chance that
the update will make it back to the dataset. If I update
the dataset instead of the form, it does not show on the
form.

Is there a method that should be used?

Thanks
Paul
Jul 21 '05 #1
3 2455
Hi Paul,

Thanks for posting to the newsgroup.

When you say you have a windows form that is bound to a datatable, what do
you mean? What type of data binding are you using to bind a table to the
form itself?

Thanks for clarifying,
bliz
--
Jim Blizzard, MCSD .NET
Community Developer Evangelist | http://www.microsoft.com/communities
Microsoft

Your Potential. Our Passion.

This posting is provided as is, without warranty, and confers no rights.

"PAUL EDWARDS" <an*******@disc ussions.microso ft.com> wrote in message
news:07******** *************** *****@phx.gbl.. .
I have a windows form that is bound to a datatable. In VB6
I could just update the field contents and it would be
updated in the database, however if I update the text
property of the control from code it is 50% chance that
the update will make it back to the dataset. If I update
the dataset instead of the form, it does not show on the
form.

Is there a method that should be used?

Thanks
Paul

Jul 21 '05 #2
Sorry it's not the form, it's most controls on the form
that are bound to columns in one of the tables in a
dataset.

The databindings.te xt property for the control
txtSalePrice is set to dsetContract (contract dataset) -
tblContract (contract table) - SalePrice (sale price
column in contact table).

According to an entry in another control I wish to set the
value in the Sale Price control. I also wish to create a
default set of comments to store with the sale depending
on values in several controls.

Hope that's clear.
Thanks
Paul
-----Original Message-----
Hi Paul,

Thanks for posting to the newsgroup.

When you say you have a windows form that is bound to a datatable, what doyou mean? What type of data binding are you using to bind a table to theform itself?

Thanks for clarifying,
bliz
--
Jim Blizzard, MCSD .NET
Community Developer Evangelist | http://www.microsoft.com/communitiesMicrosoft

Your Potential. Our Passion.

This posting is provided as is, without warranty, and confers no rights.
"PAUL EDWARDS" <an*******@disc ussions.microso ft.com> wrote in messagenews:07******* *************** ******@phx.gbl. ..
I have a windows form that is bound to a datatable. In VB6 I could just update the field contents and it would be
updated in the database, however if I update the text
property of the control from code it is 50% chance that
the update will make it back to the dataset. If I update
the dataset instead of the form, it does not show on the
form.

Is there a method that should be used?

Thanks
Paul

.

Jul 21 '05 #3
Yes, that helps quite a bit.

Are you sure there's only one record in the dataset? The DataBinding allows
you to bind a list of records to a control that doesn't display multiple
records. Perhaps you're working with a different record in the dataset?

Also, make sure the change is making it back into the dataset itself. Once
the dataset is changed, the bound controls should display the new value
(assuming the control is "pointing to" the record that's been updated).
Perhaps you could set a breakpoint and view the contents of the dataset
after you've changed the data on the screen.

If you're making changes to a textbox and want to update the underlying
dataset it's bound to, you'll have to do that in code, perhaps in a button
click event.

I created a simple test program with a couple of textboxes and a datagrid.
I DataBound the textboxes and the dataGrid to the same dataset. (Used this
approach because I knew a datagrid would update the dataset when I made a
change.) As long as I updated the first record, the changes were
automatically reflected in the textboxes.

Hope this helps,
bliz

--
Jim Blizzard, MCSD .NET
Community Developer Evangelist | http://www.microsoft.com/communities
Microsoft

Your Potential. Our Passion.

This posting is provided as is, without warranty, and confers no rights.

"Paul Edwards" <pa**@nospam. go-dcl.co.uk> wrote in message
news:09******** *************** *****@phx.gbl.. .
Sorry it's not the form, it's most controls on the form
that are bound to columns in one of the tables in a
dataset.

The databindings.te xt property for the control
txtSalePrice is set to dsetContract (contract dataset) -
tblContract (contract table) - SalePrice (sale price
column in contact table).

According to an entry in another control I wish to set the
value in the Sale Price control. I also wish to create a
default set of comments to store with the sale depending
on values in several controls.

Hope that's clear.
Thanks
Paul
-----Original Message-----
Hi Paul,

Thanks for posting to the newsgroup.

When you say you have a windows form that is bound to a

datatable, what do
you mean? What type of data binding are you using to

bind a table to the
form itself?

Thanks for clarifying,
bliz
--
Jim Blizzard, MCSD .NET
Community Developer Evangelist |

http://www.microsoft.com/communities
Microsoft

Your Potential. Our Passion.

This posting is provided as is, without warranty, and

confers no rights.

"PAUL EDWARDS" <an*******@disc ussions.microso ft.com>

wrote in message
news:07******* *************** ******@phx.gbl. ..
I have a windows form that is bound to a datatable. In VB6 I could just update the field contents and it would be
updated in the database, however if I update the text
property of the control from code it is 50% chance that
the update will make it back to the dataset. If I update
the dataset instead of the form, it does not show on the
form.

Is there a method that should be used?

Thanks
Paul

.


Jul 21 '05 #4

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

Similar topics

6
1594
by: BBM | last post by:
Hi, I'm having trouble getting control data binding to work. As I understand it, the simplest form of databinding requires three things: 1) A control (say a textbox) on a form or user control, 2) A field or object.member to which you want to bind, 3) A "Binding" object that connects the variable to a property of the control ("Text" for example).
0
5437
by: Patrick B | last post by:
I'm wondering about the mechanics of databinding. Say that a textbox is bound to a property of a business object. The business object is a "Person". The control is a textbox called "ctlFirstName", and it's bound to the "FirstName" property of "Person". Why doesn't the following work? myForm.Show(); Person p = new Person();
2
2885
by: Joe Fetters via .NET 247 | last post by:
Have googled and read the VS.NET documentation can't seem to getthe answer to the following. Environment: Framework 1.1 VB.NET WinForm Access database Using all automagic tools (DataAdapter Wizard with generatedDataset and generated Select, Update, Insert and Deletecommands, controls bound to DataSet using the AdvancedDatabinding properties) Issue: Do I have to set parameters before I issue theDataSet.Update(Dataset, )? Again, my...
3
2228
by: D. Shane Fowlkes | last post by:
I have a Datagrid which in theory, should allow you to edit and update the records. I've stripped my test page down so that it's only attempting to update one field - "description". Yet when I make the changes and click Update, it reverts back to the old value. I'm stumped! I've also checked the db table and it is infact not updating. I'm attempting to follow and example right out of ASP.NET Unleashed but not having much luck. Any...
9
12998
by: jaYPee | last post by:
I have search a lot of thread in google newsgroup and read a lot of articles but still i don't know how to update the dataset that has 3 tables. my 3 tables looks like the 3 tables from northwind database that has an employees, orders, and order details. the following are the 3 tables in my sql database students schyrsem
5
357
by: PAUL EDWARDS | last post by:
I have a windows form that is bound to a datatable. In VB6 I could just update the field contents and it would be updated in the database, however if I update the text property of the control from code it is 50% chance that the update will make it back to the dataset. If I update the dataset instead of the form, it does not show on the form. Is there a method that should be used?
0
1451
by: Redback | last post by:
Im using VS 2005. I have a form with a tab control. I have text boxes which are bound to a binding source, which is bound to a dataset. I have a button on the form that allows the user to add a new record. On clicking the button, i add a new record to the binding source. i then wanted to update a number of the textboxes with a default value. At first I was just using a recursive function to loop through each control and
8
5385
by: =?Utf-8?B?R3JlZyBMYXJzZW4=?= | last post by:
I'm trying to figure out how to modify a panel (panel1) from a backgroundworker thread. But can't get the panel to show the new controls added by the backgroundwork task. Here is my code. In this code there is a panel panel1, that I populate with a lable in the foreground. Then when I click on "button1" a backgroundworker thread in async mode is started. When the backgoundworker thread completes the thread returns a panel to populate...
1
1078
by: radhikabista | last post by:
hi, i m working on a windows application for payment schedule management of a large organization. there i need to show a column content sum at the last row of the datagrid. for this i adopted a datagrid control and customized it with the requirement and the sum is visible at the datagrid footer. now whats my problem is when i try to update the dataset bound to datgrid control nothing is updated in database. i get the original valued. i...
0
10031
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10913
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9721
agi2029
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...
1
8094
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7246
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();...
0
5930
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...
0
6134
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4770
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
2
4336
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.