Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 29th, 2003, 09:06 PM
Authorized User
 
Join Date: Jun 2003
Posts: 54
Thanks: 1
Thanked 0 Times in 0 Posts
Default DateDiff Compilation Error

Getting compiation error,-don't know why. Thanks. - Steve



Compiler Error Message: BC30451: Name 'DateDiff' is not declared.

Source Error:



Line 90: birthdate = "6/3/1944"
Line 91: curDate = DateTime.Now
Line 92: age = DateDiff(DateInterval.Year, curDate, birthdate)
Line 93: Return age.ToString
Line 94: End Function





Imports System
Imports System.Web.UI
Imports System.DateTime
Imports System.Web.UI.WebControls
Imports System.Data
Imports System.Data.OLEDB
Public Class listingdetails
    Inherits System.Web.UI.Page

'--------

Deleted irrelevant code

'-------




   Function DisplayAge(ByVal birthday As Object, ByVal birthmonth As Object, ByVal birthyear As Object) As String
    '----- see page 342 ASP.NET Data Web Controls
    Dim bday As String
    Dim bmonth As String
    Dim byear As String
    Dim birthdate As Date
    Dim curDate As Date
    Dim age As Long
    bday = birthday.ToString
    bmonth = birthmonth.ToString
    byear = birthyear.ToString
    birthdate = CDate(bmonth & "/" & bday & "/" & byear)
    birthdate = "6/3/1944"
    curDate = DateTime.Now
    age = DateDiff(DateInterval.Year, curDate, birthdate)
    Return age.ToString
  End Function
 
Old June 30th, 2003, 05:46 AM
Authorized User
 
Join Date: Jun 2003
Posts: 54
Thanks: 1
Thanked 0 Times in 0 Posts
Default

I finally found out that I have to import Microsoft.VisualBasic





Similar Threads
Thread Thread Starter Forum Replies Last Post
Compilation Error furqanms Pro Java 2 September 28th, 2007 11:22 AM
C++ Compilation error indupriyav C++ Programming 0 February 5th, 2007 08:37 AM
Compilation Error don baroo ASP.NET 1.0 and 1.1 Basics 2 August 26th, 2005 08:05 PM
compilation error msrnivas .NET Web Services 3 June 9th, 2004 07:19 AM
compilation error saint Classic ASP Databases 2 June 23rd, 2003 04:08 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.