RangeType 枚举

定义

指定要在 RangeExpression 类的实例中使用的数值比较的类型。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
继承
RangeType

字段

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.

None 0

指定搜索没有边界。Specifies that the search does not have a boundary.

示例

下面的示例演示如何在 AdventureWorks 数据库的 products 表中搜索 ListPrice 列, 以查找在FromTextBoxToTextBox文本框中指定的范围内具有标价的产品。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>  

注解

RangeExpression枚举用于指示某个值是否介于两个指定值之间。The RangeExpression enumeration is used to indicate whether a value is between two specified values. 枚举在MinType RangeExpression类的或MaxType属性中使用。The enumeration is used in the MinType or MaxType properties of the RangeExpression class.

指定最小值和最大值。You specify a minimum and a maximum value. 可以包括或排除使用RangeType类指定的值。You can include or exclude values that you specified by using the RangeType class.

下表描述了枚举值。The following table describes the enumeration values.

枚举Enumeration 说明Description
NoneNone 指定搜索没有边界。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.

适用于