EntityDataSource.SelectParameters 属性
定义
获取用于创建投影的参数的集合。Gets the collection of parameters that are used to create the projection.
public:
property System::Web::UI::WebControls::ParameterCollection ^ SelectParameters { System::Web::UI::WebControls::ParameterCollection ^ get(); };
[System.ComponentModel.Browsable(false)]
[System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)]
public System.Web.UI.WebControls.ParameterCollection SelectParameters { get; }
[<System.ComponentModel.Browsable(false)>]
[<System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)>]
member this.SelectParameters : System.Web.UI.WebControls.ParameterCollection
Public ReadOnly Property SelectParameters As ParameterCollection
属性值
用于创建投影的参数。The parameters that are used for creating the projection.
- 属性
注解
与 Select 类的方法类似 ObjectQuery<T> ,可以将参数传递给由属性定义的投影 Select 。Like the Select method of the ObjectQuery<T> class, parameters can be passed to the projection that is defined by the Select property. SelectParameters控件的属性 EntityDataSource 指定一个 ParameterCollection ,其中包含要提供给查询的 SELECT 语句的参数。The SelectParameters property of the EntityDataSource control specifies a ParameterCollection that contains the parameters to supply to the SELECT statement of the query. SelectParameters属性使用命名参数来引用提供给属性的字符串中指定的参数 Select 。The SelectParameters property uses named arguments to refer to the parameters that are specified in the string that is supplied to the Select property.
如果 SelectParameters 未设置该属性,则不会进行参数替换。If the SelectParameters property is not set, no parameter substitution is made. SELECT 语句中的所有参数名称(前缀为 "" 符号)在 @" , 中必须具有匹配的名称 ParameterCollection 。All the parameter names in the SELECT statement, prefixed by the "@" symbol, must have a matching name in the ParameterCollection. 不允许对中的参数使用 Null 值 ParameterCollection 。Null values are not allowed for parameters in a ParameterCollection.