Easy question but need urgent help!

Posted on 2003-03-27
Medium Priority
Last Modified: 2010-05-01
I am taking a class in ASP.NET.  I need to work with dates and text id fields.  I need to be able to enter a date in one text id box and a number in the other and then use the number to add days to the input date.  I cannot figure how to do this with dateadd or anything else!  Help in specific on this and I really need a good primer on using ASP.NET that does not expect you to have programmed for 10 years before you picked this application up.  Recommended reading PLEASE!
Question by:bergm57
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
LVL 39

Accepted Solution

appari earned 2000 total points
ID: 8221019
use dateadd function

DateAdd(DateInterval.Day, 2, Now)

I think MSDN is the best choice to learn.
LVL 14

Expert Comment

ID: 8221039
Convert to long ...

Dim a
a = CLng(CDate("12/10/1975"))
MsgBox a
LVL 11

Expert Comment

ID: 8221515
On Error resume next
NewDate = dateadd("d", val(txtNoDays.Text), CDate(txtInputDate.text))
if (Err.Number <> 0) then
   msgbox "Invalid date!"
   exit sub
end if

' this code is for VB.  VB.Net code should be similar.
' Good Luck!

Author Comment

ID: 8225432
Thanks!  That bit of code got me going again.  You are an ASP.NET guru!

The other code offered worked as well but not as efficient is all.  Thanks for your comments!

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month11 days, 2 hours left to enroll

770 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