Solved

the name DateAdd does not exist in this context

Posted on 2016-10-21
2
31 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
2 Comments
 
LVL 20

Accepted Solution

by:
Russ Suter earned 500 total points
Comment Utility
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
Comment Utility
ty
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

763 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now