Solved

the name DateAdd does not exist in this context

Posted on 2016-10-21
2
121 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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Change to file doesn't show up 16 93
Nested forach loop to linq 3 42
Run software updates from the website 6 50
Concurrency Error Persistent using Data Grid View Update C# 2 30
This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
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…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

738 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