473,508 Members | 2,241 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VB BindingSource.EndEdit() and DataTable.GetChanges()

29 New Member
Hello
I have some controls (textboxs,picbox,checkbox) bind to a BindingSource. And this BindingSource.DataSource to a DataTable.

I need to know if some field has been modified in order to ask for save changes.

The problem is that when I use BindingSource.EndEdit(), the DataTable.GetChanges() always return TRUE even if none of the controls has been modified.

Any idea of what I'm doing wrong?

Thanks
Mar 30 '16 #1
2 2731
madankarmukta
308 Contributor
Perform the EndEdit on the underlying DataRowView of the BindSource Just like

DataRowView row = (DataRowView)tbl.BindSource.Current;
row.EndEdit();

Then it should work.

Please let me know if this doesn't suffice the actual requirement.
Apr 3 '16 #2
LeoVBNET
29 New Member
Thanks Madankarmukta
Finally I solved this issue. All the problem was one of the controls binds to BindingSource: "PictureBox"
Don't ask me why but this control made BS.EndEdit() to 'makes changes' over the DataTable, so when I look up for changes, it always says it had changes.

So, I did this:
PictureBOX.DataBindings.Add("Image", BS, "LOGO", True, DataSourceUpdateMode.Never)

And when user changes the picture I put the new pic directly in the DataTable.

Thanks again.
Apr 4 '16 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
8480
by: JochenZ | last post by:
Hello, I have a DataGrid(View) and a DataTable. The DataTable is displayed in the DataGridView: dataGridView.DataSource = theTable; The user is allowed to select some rows and then the...
5
17119
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...
1
8643
by: Mike | last post by:
I have the following: 1 x .NET 2.0 .DLL Containing one public DataSet (CustomerHandler) which contains one table and a tableadapter to fill a datatable 1 x .NET 2.0 EXE With a single...
4
11151
by: George | last post by:
Got a question about the side effect of DataAdapter.Update() and DataTable.GetChanges(). Say I set up a DataTable and a DataAdapter in a class. Delete (Not remove) a row in the data table and...
3
5119
by: Carlos Cruz | last post by:
Hi, I've a DataGridView with Datasourse = Datatable. The problem is that I can't get my last record updated at the database unless I change the row where I'm editing... Can anyone explain me...
2
2475
by: =?Utf-8?B?Sm9iIExvdA==?= | last post by:
How can I reconcile changes between two data table and create a subset of those changes. I have two data tables with same schema which gets populated from two different xml files. I want to get...
3
4001
nev
by: nev | last post by:
my textbox displays "hello" i change the value of textbox through code like this: textbox.text = "" then i do: bindingsource.endedit() tableadapter.update(dataset.datatable)
1
8087
by: Daniel Jeffrey | last post by:
..Net 2.0 VStudio 2005 C# I know this is going to seem like a strange question, as even I am sure I have missed something - but I cant find it. I want a simple event on any of the objects...
1
1868
by: kpresario | last post by:
Hi All, Once we assigned bindingsource to a datatable, is it possible to return BindingSource as a DataTable? If I updated the some record, then i will like to retrieve the DataTable from the...
1
2347
by: thesti | last post by:
hello, i want to update database (it's MySQL so i'm using mysqldotnetconnector provided by them) using the DataAdapter. update goes well, but when i remove a row from the dataTable by using...
0
7225
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
7123
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7383
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
7498
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...
1
5053
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
4707
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
3182
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1557
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 ...
0
418
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.