473,385 Members | 1,402 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.

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 2387
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*******@discussions.microsoft.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.text 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*******@discussions.microsoft.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.text 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*******@discussions.microsoft.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
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...
0
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...
2
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...
3
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...
9
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...
5
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...
0
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...
8
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...
1
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...
1
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: 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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.