Modifying existing rows in a Dataset

  • Thread starter Thread starter Chris Bingham
  • Start date Start date
C

Chris Bingham

Hi,
I'm learning VB.Net at the moment, and while I'm doing it
I'm writing a couple of programs for work!
They all work with the same Access Database, but I'm
having a problem with modifying existing rows in the
database.
In this case I have a button that needs to enter the
current time into the database as part of an existing
record, here's the code I've got so far;

Private Sub btnStartNow_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
btnStartNow.Click
dtpStartDate.Value =
Microsoft.VisualBasic.DateAndTime.Now
txtStartTime.Text =
Microsoft.VisualBasic.DateAndTime.Now.ToShortTimeString
dgdJobsPendingHidden
(dgdJobsPending.CurrentRowIndex, 7) = dtpStartDate.Value

'don't know what to put here!'

dapJobsPendingHidden.Update
(dsetJobsPendingHidden.CADJobs)
End Sub

I'm not sure how to enter dtpStartDate.Value into the
dataset in the correct place, or how to get it to get the
changes form the dgdJobsPendingHidden datagrid!
Any help would be very much appreciated!
Thanks,
Chris
 
Write it directly into the DataSet.Table, that way you dont have to worry
about the grid Updating the Table.

Regards - OHM


Chris said:
Hi,
I'm learning VB.Net at the moment, and while I'm doing it
I'm writing a couple of programs for work!
They all work with the same Access Database, but I'm
having a problem with modifying existing rows in the
database.
In this case I have a button that needs to enter the
current time into the database as part of an existing
record, here's the code I've got so far;

Private Sub btnStartNow_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
btnStartNow.Click
dtpStartDate.Value =
Microsoft.VisualBasic.DateAndTime.Now
txtStartTime.Text =
Microsoft.VisualBasic.DateAndTime.Now.ToShortTimeString
dgdJobsPendingHidden
(dgdJobsPending.CurrentRowIndex, 7) = dtpStartDate.Value

'don't know what to put here!'

dapJobsPendingHidden.Update
(dsetJobsPendingHidden.CADJobs)
End Sub

I'm not sure how to enter dtpStartDate.Value into the
dataset in the correct place, or how to get it to get the
changes form the dgdJobsPendingHidden datagrid!
Any help would be very much appreciated!
Thanks,
Chris

Regards - OHM# OneHandedMan{at}BTInternet{dot}com
 
Thanks for everyones help! I'd tried writing directly to
the table before, but turns out i'd been referencing the
cells wrong so it didn't work! it working reat now thiough
I've ordered the CD (no broadband :-( ) so i'll just have
to wait for it to arrive!
Thanks for your help,
Chris
 
Back
Top