473,320 Members | 1,853 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,320 software developers and data experts.

Form / Dataset Changes

I have the follow function for detecting when my bound dataset has
changed (by the user, I hope).
Public Function HasFormChanges() As Boolean

Dim row As DataRow
Dim i As Integer = 0

For i = 0 To (Me.DataTable.Rows.Count - 1)

row = Me.DataTable.Rows(i)

Select Case row.RowState

Case DataRowState.Added
Return True

Case DataRowState.Modified
Return True

Case DataRowState.Deleted
Return True

End Select

Next

Return False

End Function
However, now that I know *something* has changed, I'd like to know what.
Is there any way for me to know what column header holds the value that
is added, modified or deleted?

--
- Mitchell Vincent
- kBilling - Invoices Made Easy!
- http://www.k-billing.com
Nov 21 '05 #1
6 1038
Mitchell,

With a lot of saving and using reject changes probably you can, however what
it the reason you want this. Should you not tackle the user direct at the
begin?

Cor
Nov 21 '05 #2
Hi

Have you tried to take a look at the DataTable event?
DataTable.ColumnChanged Event
http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfsystemdatadatatableclasscolumnchangedtopic.as p

Working with DataTable Events
http://msdn.microsoft.com/library/de...us/cpguide/htm
l/cpconworkingwithdatatableevents.asp

Is this what you want? If you still have any concern, please feel free to
post here.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #3
Cor Ligthert wrote:
Mitchell,

With a lot of saving and using reject changes probably you can, however what
it the reason you want this. Should you not tackle the user direct at the
begin?

Cor


Actually, that function is returning changes as soon as the form is
loaded and I have no idea why. I was going to see if I could find out
*what* column was holding the changed data so I could track down where
it is being changed and why.

--
- Mitchell Vincent
- kBilling - Invoices Made Easy!
- http://www.k-billing.com
Nov 21 '05 #4
Peter Huang [MSFT] wrote:
Hi

Have you tried to take a look at the DataTable event?


Thanks Peter, that might work!

--
- Mitchell Vincent
- kBilling - Invoices Made Easy!
- http://www.k-billing.com
Nov 21 '05 #5
Mitchel,

What happens when you load a dataset (table) is that there is as well a
function that is default set to true.

Acceptchanges during fill. I don't know when that is running.

http://msdn.microsoft.com/library/de...gfilltopic.asp

Cor
Nov 21 '05 #6
Hi

You are welcome!

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #7

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

Similar topics

0
by: Michael Dimento | last post by:
I'm trying to detect if there are any unsaved changes in a dataset when a user hits close form button (top right hand corner). My problem is that HasChanges does not detect a row that has been...
4
by: HomeyDaClown | last post by:
I'm new to the VB.net world and have been reading alot of books and threw newsgroups Is it even posable to save user input from a form to a data grid. I could just edit the data gri but would...
0
by: Glenn | last post by:
I have a list of records in a third party grid: when an item is selected, a user control (bound to a control module level dataset) is filled with the selected record. I have another form with a...
5
by: Jason Huang | last post by:
Hi, Is it possible to bind DataReader to a DataGrid in C# windows form? And how? And can we update data in a DataSet by using the DataReader? Thanks for help. Jason
3
by: Young J. Putt | last post by:
I have a vb.net datagrid bound to a dataview on a windows form. I want to use the datagrid to display and filter a list of items, but since the data is complex, I don't want the user to edit the...
5
by: Genojoe | last post by:
I am using code from Help with two exceptions. (1) I increased the number of sample rows from 3 to 20, and (2) I anchored the datagrid to bottom of form so that I can change the size of the grid by...
2
by: Gary Shell | last post by:
Sorry for the crosspost, I initially posted this to the microsoft.public.dotnet.languages.vb.data group, but it never showed up there. (Is that newsgroup still active???) I have two datasets...
1
by: astro | last post by:
Is there a command/syntax that will force a given datagrid to submit it's changes to it's dataset? I know the currencymanager is responsable for this.......just can't get it to work. I've...
3
by: TomH | last post by:
I am using VB within VS 2005. How can I have multiple datagridviews on the same form pulling from the same table? e.g. I want to see all clients from New York in one view and all clients from LA in...
2
by: polocar | last post by:
Hi, I'm writing a C# program that interfaces with a SQL Server 2005 database (I use Visual Studio 2005 Professional Edition as compiler). I have defined the classical ADO.NET SqlDataAdapter,...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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...

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.