Share via


DataFunctions.ValidateNumber Method (PIA)

Use this method to check whether a string representation of a number is valid, and optionally to check the value of the number against a specified range.

Definition

[Visual Basic .NET]

Imports Microsoft.CommerceServer.Interop
…
Public Function ValidateNumber(vtNumber As Object,
 vtMin As Object,
 vtMax As Object) As Object

[C#]

using Microsoft.CommerceServer.Interop;
…
public object ValidateNumber(objectvtNumber,
 objectvtMin,
 objectvtMax);

Parameters

[Visual Basic .NET]

  • vtNumber
    An Object that contains a string representation of a number to validate.
  • 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 the vtMax parameteris Null, which means that this parameteris ignored in the range validation.

[C#]

  • vtNumber
    An object that contains a string representation of a number to validate.
  • 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 the vtMax parameteris null, which means that this parameteris ignored in the range validation.

Return Values

[Visual Basic .NET] If this method completes successfully, it returns a Boolean Object that indicates whether the vtNumber parameter is valid. A value of True indicates the vtNumber parameter is a valid whole number, and that it is within the given range, if any.

[C#] This method returns an object containing a bool that indicates whether the vtNumber parameter is valid. A value of true indicates the vtNumber parameter is a valid whole number, 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]

Dim Result As Object
Dim Amount As Object
DataFunctions df = New DataFunctions()
' Set Locale to USA
myLocale = 1033
df.Locale = myLocale
myInt = 24
Result = df.ValidateNumber(myInt , 1, 10)
Response.Write(myInt & " Is this integer between 1 & 10?: " & _
    " " & Result & "<P>")
myInt = 2
Result = df.ValidateNumber(myInt , 1, 10)
Response.Write(myInt & " Is this integer between 1 & 10?: " & _
    " " & Result & "<P>")

[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.Number

DataFunctions.ConvertNumberString

Copyright © 2005 Microsoft Corporation.
All rights reserved.