473,503 Members | 12,003 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Datatable updating pbs.

fh
Hello,

I modify one row of a datatable
with this code

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

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

Franck
Nov 17 '05 #1
4 2140
Franck,

Calling BeginEdit and EndEdit doesn't commit the changes to the
database. The DataSet is disconnected, meaning that the data you have in
the DataSet is not connected to the database it came from in any way.

In order to update the records, you have to pass the dataset to a
DataAdapter (preferably, the one you used to select the data) through the
Update method.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

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

I modify one row of a datatable
with this code

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

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

Franck

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

Nicholas Paldino [.NET/C# MVP] wrote:
Franck,

Calling BeginEdit and EndEdit doesn't commit the changes to the
database. The DataSet is disconnected, meaning that the data you have in
the DataSet is not connected to the database it came from in any way.

In order to update the records, you have to pass the dataset to a
DataAdapter (preferably, the one you used to select the data) through the
Update method.

Hope this helps.

Nov 17 '05 #3
fh,

If you change a value on a column in a row, then the row state of the
row should change automatically.

Are you filtering on the rowstate perhaps and you don't know it?

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"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 (apparently not...)

Nicholas Paldino [.NET/C# MVP] wrote:
Franck,

Calling BeginEdit and EndEdit doesn't commit the changes to the
database. The DataSet is disconnected, meaning that the data you have in
the DataSet is not connected to the database it came from in any way.

In order to update the records, you have to pass the dataset to a
DataAdapter (preferably, the one you used to select the data) through the
Update method.

Hope this helps.


Nov 17 '05 #4
fh
Nicholas Paldino [.NET/C# MVP] wrote:
fh,

If you change a value on a column in a row, then the row state of the
row should change automatically.

Are you filtering on the rowstate perhaps and you don't know it?

thank you for your answer,
in fact no
to view my data i use:

txbDate.Text=
drLigneCourante["ValidationDate",DataRowVersion.Current].ToString();

so the state is current
Nov 17 '05 #5

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

Similar topics

6
4217
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
2960
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...
8
5342
by: Greg Peck | last post by:
Hi I need to update a field (fldX) in one DataTable (dt1) where there is a match on fldA in another DataTable (dt2). Is the only way to do this by itterating through the DataRows of dt1,...
1
19738
by: Lars E | last post by:
Hi all I have a small problem. I have a datatable with 8 columns. But it is only data in 5 of the columns. Data for the remaing 3 columns is in another dataset. I Want to run trough the...
3
5118
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...
0
1760
by: Maart_newbie | last post by:
Hi all, I've got a question about returning the value of a pk-column to a DataTable after inserting a row (via a data-adapter) using MySql5. Here is the SQL and code concerned: ...
1
8200
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
1455
by: Chet | last post by:
I have a Datagrid that is bound to a Datatable at runtime. I allow the user to select a number of rows using the mouse and then click a button that says "check selected rows", which then cycles...
0
1209
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
1919
by: Wavey | last post by:
Hi All, I have a problem with updating an Access database from a datatable. I have two rows of data in my database at the moment for testing, the first row is an ID number (primary key), the...
0
7193
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
7067
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
7264
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
7449
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
4992
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
3148
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1495
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 ...
1
728
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
371
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.