473,467 Members | 1,303 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

HasChanges not being updated?

Hi all,

I'm sure I must be missing something here.. I've created a simple parent -
child form appl. in which I open a dataset in the parent (MDI) using a
dataadaptor to an Access database, and a dataset.

The SELECT of the record set searches for a specific entry, if it returns a
0 rowcount, I go throiugh the motions of adding a row, and opening the child
form.. if it is found I just open the child form..

I am passing the dataset through the constuctor to my child form, and if I
use a datagrid to change the data, it marks the HasChanges correctly.
But, as i am only dealing with one row here, and I would like to use text
boxes for each column, I have tried to bind these in code - taken from the
..NET library...DataBindings entry...

The problem is, if I change the data in a text box, (incidentally, if I
leave the datagrid on the form, the cell appears to update for the changed
text), the HasChanges flag is not being set to True. Is there something I
need to code that will cause this to happen?

Here's a snippet of the code...

Parent form:

With daLinkMAN_client_trans

.SelectCommand.Parameters("nman_path").Value = str_nman_path

.Fill(dsLinkMAN)

End With

' if empty then add

If dsLinkMAN.Tables("client_trans").Rows.Count = 0 Then

Dim dr_client_trans As DataRow

dr_client_trans = dsLinkMAN.Tables("client_trans").NewRow

With dr_client_trans

.Item("nman_path") = str_nman_path

.Item("description") = "New database"

.Item("summit_client_id") = ""

dsLinkMAN.Tables("client_trans").Rows.Add(dr_clien t_trans)

End With

End If

' open client form

Dim frm As New frmClient(daLinkMAN_client_trans, dsLinkMAN, cnLinkMAN)

' frm.MdiParent = Me

frm.ShowDialog()

Debug.WriteLine(dsLinkMAN.HasChanges)

Debug.WriteLine(dsLinkMAN.HasErrors)

daLinkMAN_client_trans.Update(dsLinkMAN.Tables("cl ient_trans"))

dsLinkMAN.Tables("client_trans").Clear()

In the Child form I have...

txtpath.DataBindings.Add(New Binding("Text", ds_client_trans,
"client_trans.nman_path"))

txtdescription.DataBindings.Add(New Binding("Text", ds_client_trans,
"client_trans.description"))

txtclient.DataBindings.Add(New Binding("Text", ds_client_trans,
"client_trans.summit_client_id"))

DataGrid1.DataSource = ds_client_trans.Tables("client_trans")
If anyone could shed any light on this I'd be most grateful.

Thanks,
Graham
Nov 20 '05 #1
1 987


Nov 20 '05 #2

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

Similar topics

3
by: Graham Blandford | last post by:
Hi all, I'm sure I must be missing something here.. I've created a simple parent - child form appl. in which I open a dataset in the parent (MDI) using a dataadaptor to an Access database, and...
2
by: jbsound | last post by:
I have been banging my head against this one and I'm sure I'm missing something: Got a WinForms app in VB.NET with controls bound to a dataset. For the sake of this discussion, let's use just...
2
by: Klatuu | last post by:
I've tried to follow the threads regarding using the HASCHANGES method but still cannot understand how to use it. Situation is this: single dataset, single table, bound to controls on a form....
4
by: thead01 | last post by:
I create a dataset, load xmlfile, create dataview (ds.defaultview) and bind it to a datagrid (dataset haschanges property is now 'true'). When a user closes the form I want to check via...
0
by: Evelin | last post by:
Hi, I use ASP.NET and my problem is I´ve two buttons, a dataSet, a dataGrid and a sqlDataAdpater, I use sqlDataAdapter.fill(dataSet,"dbTable"), then when when the user press the first button, I...
30
by: dbuchanan | last post by:
ComboBox databindng Problem == How the ComboBox is setup and used: My comboBox is populated by a lookup table. The ValueMember is the lookup table's Id and the DisplayMember is the text from a...
2
by: mrstrong | last post by:
Gday, Have been going through the walkthrough for a distributed application: http://msdn2.microsoft.com/en-us/library/1as0t7ff.aspx and it appears to suggest in the SaveData_Click method that...
7
by: darjonase | last post by:
I am having a problem, and I wonder if anyone could help me with it. I have two methods. The first on a form calls the second method which is located in a class lib. 'Form Method Private Sub...
2
by: mikeficklonni | last post by:
Hello, I am very new to C# and .Net. I may be overlooking something very simple here, however, even after reading several forums I'm still stumped. I can't get the HasChanges method to work. ...
4
by: John | last post by:
Hello, I was wondering if it was possibly to bind a control to a dataset.haschanges property. The reason I want to do this is so that a little warning shows up on the form saying that the...
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
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...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.