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

Detect Changes to maually built DataTable

Joe
Hi

I am building a datatable manually and putting in a grid

I would like to edit a row then determine that the table has changes and
needs to be saved

The problem I am having is that all the rows in the datatable have a state
of "added" and when I change
a row it still has a RowState of Added

Is there some other way to detect that a row was changed after it was added
to a table???

Thanks
Apr 24 '06 #1
2 2553
Build the DataTable.. add the Table to a dataset, then Bind the DataSet's
datatable to the grid.., the below statement has to help you then....

<dataTbl>.DataSet.HasChanges(DataRowState.Modified ); // modified rows..

<dataTbl>.DataSet.HasChanges(DataRowState.Added) ; // modified rows..

read MSDN for more help on this property...

Vijay

"Joe" <hc******@yahoo.com> wrote in message
news:%2******************@TK2MSFTNGP04.phx.gbl...
Hi

I am building a datatable manually and putting in a grid

I would like to edit a row then determine that the table has changes and
needs to be saved

The problem I am having is that all the rows in the datatable have a state
of "added" and when I change
a row it still has a RowState of Added

Is there some other way to detect that a row was changed after it was
added to a table???

Thanks

Apr 25 '06 #2
>I am building a datatable manually and putting in a grid
I would like to edit a row then determine that the table has changes and
needs to be saved
The problem I am having is that all the rows in the datatable have a state
of "added" and when I change a row it still has a RowState of Added


How about calling the .RejectChanges() method on the DataTable once
you've completely populated it? I've never tried your exact scenario,
but if you use the "normal" case where ADO.NET retrieves the rows from
a database, calling .RejectChanges() will discard any changes you may
have made, and I'm pretty sure the RowState will be "unmodified" after
that call.

Marc
Apr 25 '06 #3

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

Similar topics

1
by: Jordan | last post by:
Hello ! I wish to detect the changes made and register in another table, Can I load a function that runs standalone and detects the changes himself ? Or I have to call the function in the...
3
by: Maulin Vasavada | last post by:
Hi, I have DataTable and I want to actually put a LinkLabel in one the columns where I can click an do something BUT it seems I can't put LinkLabel in the table cell of DataTable. So as an...
4
by: Glenn Owens | last post by:
I have a DataGrid web control which I've dynamically populated with template columns to be used for bulk-editting. Generally, all of the columns are textbox and/or dropdownlist child controls. ...
1
by: Bob | last post by:
I am developing a database app using vb.net and SQL Server. I am trying to come up with a way I can detect if the user has made any changes/updates to any data currently displayed on the form so that...
2
by: eBob.com | last post by:
I've got the basics of an XML ini file working. I.E. I can stash away and retrieve user preferences. (Code below.) But how do I handle a new preference? Say I have A and B. And then I invent...
14
by: Ron L | last post by:
All I am working with a DataGrid and a form consisting of a number of text, checkbox, combobox controls, all bound to the same datatable. When I click on my "New" button, I create a new row,...
2
by: Brian Tkatch | last post by:
How do i detect a datagrid row change? Currently, i have a few datagrids that i keep in sync, refreshing from the database whenver a row changes. I would like to avoid CurrentCellChanged because...
2
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...
5
by: Doug Bell | last post by:
Hi I have a DataGrid that has a DataView as its DataSource. I need to detect when a New Row is added or when a Row is Deleted so that I change data in the underlying DataTable. I found that...
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: 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?
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
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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,...

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.