472,374 Members | 1,497 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,374 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 2287
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...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...

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.