473,466 Members | 1,389 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Datatable updating pb...

fh
Hello,

I modifie one row of a datatable
with this code

DataRow drCurent = _dsDowntime.Tables["PPE_DOWNTIME"].Rows[numRow];
drCurent.BeginEdit();
drCurent["Automatic"]=txbCAuto.Text;
drCurent["DowntimeStart"]=txbbeg.Text;
drCurent["DowntimeEnd"]=txbEnd.Text;
drCurent.EndEdit();

but i can't see any change when i reload the data
even if i ask for their current state

Any help please
Franck
Nov 19 '05 #1
5 1382
Franck,

EndEdit doesn't save data to the database, it just ends the edit occuring on
the row.

Eliyahu

"fh" <fh@fh.com> wrote in message news:de**********@s1.news.oleane.net...
Hello,

I modifie one row of a datatable
with this code

DataRow drCurent = _dsDowntime.Tables["PPE_DOWNTIME"].Rows[numRow];
drCurent.BeginEdit();
drCurent["Automatic"]=txbCAuto.Text;
drCurent["DowntimeStart"]=txbbeg.Text;
drCurent["DowntimeEnd"]=txbEnd.Text;
drCurent.EndEdit();

but i can't see any change when i reload the data
even if i ask for their current state

Any help please
Franck

Nov 19 '05 #2
fh
thanks for your answer
but when I wrote, reload the data,
I meant from the dataset modified (apprently not...)

Eliyahu Goldin wrote:
Franck,

EndEdit doesn't save data to the database, it just ends the edit occuring on
the row.

Eliyahu

"fh" <fh@fh.com> wrote in message news:de**********@s1.news.oleane.net...
Hello,

I modifie one row of a datatable
with this code

DataRow drCurent = _dsDowntime.Tables["PPE_DOWNTIME"].Rows[numRow];
drCurent.BeginEdit();
drCurent["Automatic"]=txbCAuto.Text;
drCurent["DowntimeStart"]=txbbeg.Text;
drCurent["DowntimeEnd"]=txbEnd.Text;
drCurent.EndEdit();

but i can't see any change when i reload the data
even if i ask for their current state

Any help please
Franck


Nov 19 '05 #3
You lneed to call AcceptChanges method on either DataRow or DataTable or
DataSet.

The following is from the MSDN Library topic:

You can confirm edits by calling EndEdit or you can cancel them by calling
CancelEdit. Note that while EndEdit does confirm your edits, the DataSet
does not actually accept the changes until AcceptChanges is called. Note
also that if you call AcceptChanges before you have ended the edit with
EndEdit or CancelEdit, the edit is ended and the Proposed row values are
accepted for both the Current and Original row versions. In the same manner,
calling RejectChanges ends the edit and discards the Current and Proposed
row versions. Calling EndEdit or CancelEdit after calling AcceptChanges or
RejectChanges has no effect because the edit has already ended.
Eliyahu

"fh" <fh@fh.com> wrote in message news:de**********@s1.news.oleane.net...
thanks for your answer
but when I wrote, reload the data,
I meant from the dataset modified (apprently not...)

Eliyahu Goldin wrote:
Franck,

EndEdit doesn't save data to the database, it just ends the edit occuring on the row.

Eliyahu

"fh" <fh@fh.com> wrote in message news:de**********@s1.news.oleane.net...
Hello,

I modifie one row of a datatable
with this code

DataRow drCurent = _dsDowntime.Tables["PPE_DOWNTIME"].Rows[numRow];
drCurent.BeginEdit();
drCurent["Automatic"]=txbCAuto.Text;
drCurent["DowntimeStart"]=txbbeg.Text;
drCurent["DowntimeEnd"]=txbEnd.Text;
drCurent.EndEdit();

but i can't see any change when i reload the data
even if i ask for their current state

Any help please
Franck


Nov 19 '05 #4
fh
Eliyahu Goldin wrote:
You lneed to call AcceptChanges method on either DataRow or DataTable or
DataSet.
DataRow drCurent = _dsDowntime.Tables["PPE_DOWNTIME"].Rows[numRow];
drCurent.BeginEdit();
drCurent["Automatic"]=txbCAuto.Text;
drCurent["DowntimeStart"]=txbbeg.Text;
drCurent["DowntimeEnd"]=txbEnd.Text;
drCurent.EndEdit();

thanks for your answer
I have added the folowing line to my code

drCurent.AcceptChanges();
bool test = _dsDowntime.HasChanges();

test returned false....
The following is from the MSDN Library topic:

You can confirm edits by calling EndEdit or you can cancel them by calling
CancelEdit. Note that while EndEdit does confirm your edits, the DataSet
does not actually accept the changes until AcceptChanges is called. Note
also that if you call AcceptChanges before you have ended the edit with
EndEdit or CancelEdit, the edit is ended and the Proposed row values are
accepted for both the Current and Original row versions. In the same manner,
calling RejectChanges ends the edit and discards the Current and Proposed
row versions. Calling EndEdit or CancelEdit after calling AcceptChanges or
RejectChanges has no effect because the edit has already ended.
Eliyahu

"fh" <fh@fh.com> wrote in message news:de**********@s1.news.oleane.net...
thanks for your answer
but when I wrote, reload the data,
I meant from the dataset modified (apprently not...)

Eliyahu Goldin wrote:
Franck,

EndEdit doesn't save data to the database, it just ends the edit


occuring on
the row.

Eliyahu

"fh" <fh@fh.com> wrote in message
news:de**********@s1.news.oleane.net...
Hello,

I modifie one row of a datatable
with this code

DataRow drCurent = _dsDowntime.Tables["PPE_DOWNTIME"].Rows[numRow];
drCurent.BeginEdit();
drCurent["Automatic"]=txbCAuto.Text;
drCurent["DowntimeStart"]=txbbeg.Text;
drCurent["DowntimeEnd"]=txbEnd.Text;
drCurent.EndEdit();

but i can't see any change when i reload the data
even if i ask for their current state

Any help please
Franck


Nov 19 '05 #5
Naturally enough. If you check HasChanges() before AcceptChanges(), it
should return true. AcceptChanges() resets everything as if no changes
occured. I think, even if you call it for a datarow, it accepts the row
change all the way up to the dataset.

Eliyahu

"fh" <fh@fh.com> wrote in message news:de**********@s1.news.oleane.net...
Eliyahu Goldin wrote:
You lneed to call AcceptChanges method on either DataRow or DataTable or
DataSet.
>>>>DataRow drCurent = _dsDowntime.Tables["PPE_DOWNTIME"].Rows[numRow];
>>>>drCurent.BeginEdit();
>>>>drCurent["Automatic"]=txbCAuto.Text;
>>>>drCurent["DowntimeStart"]=txbbeg.Text;
>>>>drCurent["DowntimeEnd"]=txbEnd.Text;
>>>>drCurent.EndEdit();
thanks for your answer
I have added the folowing line to my code

drCurent.AcceptChanges();
bool test = _dsDowntime.HasChanges();

test returned false....
The following is from the MSDN Library topic:

You can confirm edits by calling EndEdit or you can cancel them by

calling CancelEdit. Note that while EndEdit does confirm your edits, the DataSet
does not actually accept the changes until AcceptChanges is called. Note
also that if you call AcceptChanges before you have ended the edit with
EndEdit or CancelEdit, the edit is ended and the Proposed row values are
accepted for both the Current and Original row versions. In the same manner, calling RejectChanges ends the edit and discards the Current and Proposed row versions. Calling EndEdit or CancelEdit after calling AcceptChanges or RejectChanges has no effect because the edit has already ended.
Eliyahu

"fh" <fh@fh.com> wrote in message news:de**********@s1.news.oleane.net...
thanks for your answer
but when I wrote, reload the data,
I meant from the dataset modified (apprently not...)

Eliyahu Goldin wrote:

Franck,

EndEdit doesn't save data to the database, it just ends the edit


occuring on
the row.

Eliyahu

"fh" <fh@fh.com> wrote in message


news:de**********@s1.news.oleane.net...
>Hello,
>
>I modifie one row of a datatable
>with this code
>
>DataRow drCurent = _dsDowntime.Tables["PPE_DOWNTIME"].Rows[numRow];
>drCurent.BeginEdit();
>drCurent["Automatic"]=txbCAuto.Text;
>drCurent["DowntimeStart"]=txbbeg.Text;
>drCurent["DowntimeEnd"]=txbEnd.Text;
>drCurent.EndEdit();
>
>but i can't see any change when i reload the data
>even if i ask for their current state
>
>Any help please
>Franck


Nov 19 '05 #6

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

Similar topics

6
by: Stephan Steiner | last post by:
Hi I have written a .NET service that uses two DataTables to store runtime data. One column in one table is periodically updated (every 10 seconds, and upon user request), another is updated...
1
by: Mike | last post by:
I have an ASP.NET/VB app that updates values in a DataTable over the course of about 3 different pages. On the way out of the first of these pages, I explicitly build the DataTable from values in...
1
by: Mike | last post by:
I have an ASP.NET/VB app that updates values in a DataTable over the course of about 3 different pages. On the way out of the first of these pages, I explicitly build the DataTable from values in...
1
by: joel | last post by:
hi guys... i am a student, i am studying and i am a newbie in VB.net and i am using SQL Server 2000. I have this datatable which i insert rows (may take up to 2 or more rows because i would...
0
LoanB
by: LoanB | last post by:
Hey guys need some info here. I am adding, updating and deleting data on a datagrid. I pass the datagrid's datasource (datatable dt) to my data layer. Assuming I have already created and...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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...
1
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
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
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: 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.