Share via


DataFunctions.ValidateDateTime Method (PIA)

Use this method to check whether a string contains a valid date, time, or date and time, and optionally to check against a specified range.

Definition

[Visual Basic .NET]

Imports Microsoft.CommerceServer.Interop
…
Public Function ValidateDateTime(vtDate As Object,
 vtMin As Object,
 vtMax As Object) As Object

[C#]

using Microsoft.CommerceServer.Interop;
…
public object ValidateDateTime(objectvtDate,
 objectvtMin,
 objectvtMax);

Parameters

[Visual Basic .NET]

  • vtDate
    An Object that contains the value to validate. This value can be a date, a time, or both.
  • vtMin
    An Object that contains a value specifying the low end of the range. The default value for this parameter is Null, which means that the vtMin parameter is ignored in the range validation.
  • vtMax
    An Object that contains a value specifying the high end of the range. The default value for this parameter is Null, which means that the vtMax parameter is ignored in the range validation.

[C#]

  • vtDate
    An object that contains the value to validate. This value can be a date, a time, or both.
  • vtMin
    An object that contains a value specifying the low end of the range. The default value for this parameter is null, which means that the vtMin parameter is ignored in the range validation.
  • vtMax
    An object that contains a value specifying the high end of the range. The default value for this parameter is null, which means that the vtMax parameter is ignored in the range validation.

Return Values

[Visual Basic .NET] If this method completes successfully, it returns a Boolean Object indicating whether the vtDate parameter is valid. A value of True indicates the vtDate parameter is a valid date, time, or date/time, and that it is within the given range, if any.

[C#] This method returns an object containing a bool that indicates whether the vtDate parameter is valid. A value of true indicates the vtDate parameter is a valid date, time, or date/time, and that it is within the given range, if any.

Exceptions

This method may throw one of many mapped exceptions or an exception of type COMException. See Standard COM Errors for additional details.

Example

[Visual Basic .NET]

' oResult is an Object, oSourceDate is an Object containing
' a string representation of a date or date and time
DataFunctions df = New DataFunctions()
oResult = df.ValidateDateTime(oSourceDate, "1/1/1900", _
  "12/31/2525")

[C#]

No example available.

Requirements

Namespace: Microsoft.CommerceServer.Interop

Platforms: Windows 2000, Windows Server 2003

Assembly: mscsasphelplib (in mscsasphelplib.dll)

See Also

DataFunctions Class

DataFunctions.Date

DataFunctions.DateTime

DataFunctions.Time

DataFunctions.ConvertDateString

DataFunctions.ConvertDateTimeString

DataFunctions.ConvertTimeString

Copyright © 2005 Microsoft Corporation.
All rights reserved.