Avatar of Jimbo99999
Jimbo99999Flag for United States of America

asked on 

VB.Net - DataGridView update LastUpdated field in SQL Table

Good Day Experts!

I am shopping for assitance with a new task in my project that I do not understand hot to achieve it in VB.net.  I have a DataGridView that presents the User with SQL table data.  The User updates the data ans hits the <Update> button and the updates are written back to the SQL table.

My new task is in that SQL table I need to update the [LAST UPDATED] field when a change is made to a record.  

So far I have gone down this path:
    1)Put [LAST UPDATED] in my DataGridView so it can be in the dataTable that gets pulled
       down from db so I can send changes to it back to the database
    2)So, now have to figure out how to get the current date/time stamp into the
       DataGridView Last Update column when changes to the record in the DataGridView
       is made?
    3)When I run the UpdateCommand then it gets updated back to the database?

Am I on the right track? If, so what do I do next?

Thanks,
jimbo99999
Visual Basic.NET

Avatar of undefined
Last Comment
Jimbo99999
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Do you use adapter to update? Does user only change one row? Or multiple rows? You can use a trigger on the table though its not the preferred approach.
Avatar of Jimbo99999
Jimbo99999
Flag of United States of America image

ASKER

Hello

Yes I am using the adapter and they can change multiple row in the grid at a time.
ASKER CERTIFIED SOLUTION
Avatar of adriankohws
adriankohws
Flag of Singapore image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of Jimbo99999
Jimbo99999
Flag of United States of America image

ASKER

Excellent...I was able to get it working with your suggestion.  Thanks for the helpful link as well.

jimbo99999
Visual Basic.NET
Visual Basic.NET

Visual Basic .NET (VB.NET) is an object-oriented programming language implemented on the .NET framework, but also supported on other platforms such as Mono and Silverlight. Microsoft launched VB.NET as the successor to the Visual Basic language. Though it is similar in syntax to Visual Basic pre-2002, it is not the same technology,

96K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo