473,320 Members | 1,814 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.

datatable.HasChanges() ?

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 you can check a
datatable for changes, ie

if (CustomerData.HasChanges())

However when I try to build this I get the error:

Error 1 '<blah>DataTable' does not contain a definition for 'HasChanges'

Am I doing something stupid or do datatables not have this method available?

Thanks,

Peter

Dec 21 '05 #1
5 17101
mrstrong <mr******@hotmail.com> wrote:
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 you can check a
datatable for changes, ie

if (CustomerData.HasChanges())

However when I try to build this I get the error:

Error 1 '<blah>DataTable' does not contain a definition for 'HasChanges'

Am I doing something stupid or do datatables not have this method available?


There is no DataTable.HasChanges() method - there is only
DataSet.HasChanges().

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Dec 21 '05 #2
"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
mrstrong <mr******@hotmail.com> wrote:

and it appears to suggest in the SaveData_Click method that you can check
a
datatable for changes, ie

if (CustomerData.HasChanges())

However when I try to build this I get the error:

Error 1 '<blah>DataTable' does not contain a definition for 'HasChanges'

Am I doing something stupid or do datatables not have this method
available?


There is no DataTable.HasChanges() method - there is only
DataSet.HasChanges().


Thanks. So the 'save' method on the walkthrough was not right?

http://msdn2.microsoft.com/en-us/library/1as0t7ff.aspx

Regards,

Peter

Dec 21 '05 #3
mrstrong <mr******@hotmail.com> wrote:
There is no DataTable.HasChanges() method - there is only
DataSet.HasChanges().


Thanks. So the 'save' method on the walkthrough was not right?

http://msdn2.microsoft.com/en-us/library/1as0t7ff.aspx


Looks like it, yes.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Dec 21 '05 #4
Correct the DataTable class just defines DataTable.GetChanges() Method.

Dec 21 '05 #5
"theiwaz" <ma***********@ascirum.de> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
Correct the DataTable class just defines DataTable.GetChanges() Method.


Hmmm.. Not in front of my work machine at present so cant try this out, but
can a datatable be NULL?

So could the following be used to test for changes to a datatable:

if (DataTable.GetChanges() != NULL)

?

(not sure about the exact syntax)

Peter


Dec 21 '05 #6

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

Similar topics

4
by: David Thielen | last post by:
Hi; How can I mark a DataTable as dirty (has changes)? I need to do this because when I add a DataColumn to a DataTable, it does not set HasChanges() to true. thanks - dave
5
by: fh | last post by:
Hello, I modifie one row of a datatable with this code DataRow drCurent = _dsDowntime.Tables.Rows; drCurent.BeginEdit(); drCurent=txbCAuto.Text; drCurent=txbbeg.Text; drCurent=txbEnd.Text;
1
by: Osmosis | last post by:
I have a dataset with several different tables and also a combobox with the names of those tables. I'd like the names in the combobox to be bold when the table has any changes. A dataset has...
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...
4
by: Tedmond | last post by:
Dear all, How to code a Web Service function that returns either a DataTable or DataReader to the clients? Or I should use other alternative? Thanks for any help! Tedmond
2
by: Joe | last post by:
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...
1
by: andrewcw | last post by:
I have just 1 table that I am updating, the SQL I use to generate the DataTable is complex using multiple tables, however when I view the fieldnames of the DataTable from the DataSet - everything...
1
by: Tedmond | last post by:
Dear all, Is it possible to pass a DataTable as a parameter to a Web function? I have failed to do that. How? Thanks for any help! Tedmond
2
by: RSH | last post by:
Hi, Iam struggling with an application where I am trying to transfer a datarow from one sql server to another instance of sql server. The schmeas may be slightly different and I am getting an...
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. ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
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...
1
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: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.