473,403 Members | 2,366 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,403 software developers and data experts.

Modifying existing rows in a Dataset

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.ToShortTimeS tring
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
Nov 20 '05 #1
3 1482
Cor
Hi Chris,

There is still a lot to do, in your code

Here is a link to the vb.net resource kit, there are a lot of walkthrougs
and samples in that

http://msdn.microsoft.com/vbasic/vbrkit/default.aspx

And if you have problems installing it

http://msdn.microsoft.com/vbasic/vbr...q/#installvdir

I hope this helps a little bit?

Cor
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.ToShortTimeS tring
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!

Nov 20 '05 #2
Write it directly into the DataSet.Table, that way you dont have to worry
about the grid Updating the Table.

Regards - OHM
Chris Bingham wrote:
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.ToShortTimeS tring
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
Nov 20 '05 #3
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
-----Original Message-----
Hi Chris,

There is still a lot to do, in your code

Here is a link to the vb.net resource kit, there are a lot of walkthrougsand samples in that

http://msdn.microsoft.com/vbasic/vbrkit/default.aspx

And if you have problems installing it

http://msdn.microsoft.com/vbasic/vbr...q/#installvdir

I hope this helps a little bit?

Cor
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.ToShortTimeS tring
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!

.

Nov 20 '05 #4

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

Similar topics

0
by: Dave Elliott | last post by:
After inserting a new data row to a DataTable that is bound to a datagrid, I am unable to change data in a row that is after the newly added row without getting bizarre results. I have added the...
5
by: Wayne Wengert | last post by:
I am using VB ASP.NET. In my page I convert an uploaded XML file to a dataset as follows: Dim ds1 As DataSet = New DataSet ds1.ReadXml(strPathName, XmlReadMode.Auto) Now I want to append...
3
by: Chris | last post by:
I have a dataset that I want to modify the values in a particular column. I.e if I have a function to convert the enterbyID (Integer) to a name, in the dataset the field (Concern_EnteredbyID) shows...
6
by: JohnR | last post by:
I have a table with 1 row which is used to hold some application wide items (one item per field, hence I only need 1 row). I want to bind one of the fields to a textbox. After setting up the...
4
by: rodchar | last post by:
hey all, i have an Access Database with about 43,000 records in it. I need to take 2 or 3 columns and modify them and update the database. currently what i'm doing is loading all into a...
1
by: Trev | last post by:
I would be very grateful if someone could help me with this. I have created a DataSet using Tables.Add(mDataSource), where mDataSource derives from database expressions. However, I now need to...
0
by: davidz | last post by:
My office has adopted Team Foundation Server to track and manage the development and deployment process at our site. I have been asked to modify one of the standard work item reports, "Related...
2
by: Steve | last post by:
Is there a way to keep adding rows to an existing dataset? I have a stored procedure that I need to call for every value, I then need to add the results of the stored procedure to the same dataset...
2
by: Manglio | last post by:
Well, I'm trying to delete / modify rows from a database that the program created before. But I cant get it to work. This is my code: DataSet Dset = new DataSet(); ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...
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
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
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.