Solved

the name DateAdd does not exist in this context

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Data Saving 5 56
Code works but I need to redo it and assign values to Model 7 33
Turn on intranet settings 1 42
Error on link 14 40
Introduction                                                 Was the var keyword really only brought out to shorten your syntax? Or have the VB language guys got their way in C#? What type of variable is it? All will be revealed.   Also called…
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 video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

863 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

28 Experts available now in Live!

Get 1:1 Help Now