Επεξεργασία

Κοινή χρήση μέσω


RangeType Enum

Definition

Specifies the type of numeric comparison to use in an instance of the RangeExpression class.

public enum class RangeType
public enum RangeType
type RangeType = 
Public Enum RangeType
Inheritance
RangeType

Fields

Name Value Description
None 0

Specifies that the search does not have a boundary.

Exclusive 1

Specifies a greater-than-or-less-than comparison. Corresponds to the > or < operator.

Inclusive 2

Specifies an equal-to-or-greater-than comparison or an equal-to-or-less-than comparison. Corresponds to the >= or <= operator.

Examples

The following example shows how to search the ListPrice column in the Products table of the AdventureWorks database for products that have a list price in the range specified in the FromTextBox and ToTextBox text boxes. The filter includes the specified minimum value in search results by using the Inclusive property but excludes the specified maximum value. This code example is part of a larger example provided in Walkthrough: Filtering Data in a Web Page Using Declarative Syntax.

<asp:RangeExpression DataField="ListPrice"    
    MinType="Inclusive" MaxType="Exclusive">  
  <asp:ControlParameter ControlID="FromTextBox" />  
  <asp:ControlParameter ControlID="ToTextBox" />  
</asp:RangeExpression>  

Remarks

The RangeExpression enumeration is used to indicate whether a value is between two specified values. The enumeration is used in the MinType or MaxType properties of the RangeExpression class.

You specify a minimum and a maximum value. You can include or exclude values that you specified by using the RangeType class.

The following table describes the enumeration values.

Enumeration Description
None Specifies that the search does not have a boundary.
Inclusive Performs a greater-than-or-less-than comparison. Corresponds to the >= or <= operation.
Exclusive Performs a greater-than-or-less-than comparison. Corresponds to the > or < operation.

Applies to