Solved

the name DateAdd does not exist in this context

Posted on 2016-10-21
2
139 Views
Last Modified: 2016-10-21
I am new to C# as of this morning. The name DateAdd does not exist in this context ... could anybody tell me how to get rid of this error. I think i have to add something by namespaces but not sure what.
Capture.JPG
0
Comment
Question by:vbnetcoder
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 20

Accepted Solution

by:
Russ Suter earned 500 total points
ID: 41854018
You would do it like this:
            DateTime testUTC = DateTime.UtcNow;
            Row.ModifiedOut = testUTC.AddHours(intHoursDifference);

Open in new window

In .NET the DateTime object has many built-in methods for manipulating the date and time. A full list of them can be found here: https://msdn.microsoft.com/en-us/library/system.datetime_methods(v=vs.110).aspx
0
 

Author Closing Comment

by:vbnetcoder
ID: 41854129
ty
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

631 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question