DataPointCollection.DataBindY 方法
定义
将集合数据点的 Y 值绑定到指定数据源第一列的数据。Data binds the Y-value(s) of the collection's data points to the first column of the specified data source(s).
重载
| DataBindY(IEnumerable[]) |
将集合数据点的 Y 值绑定到指定数据源第一列的数据。Data binds the Y-value(s) of the collection's data points to the first column of the specified data source(s). |
| DataBindY(IEnumerable, String) |
将数据点的 Y 值绑定到指定数据源的指定列的数据。Data binds the Y-value(s) of the data points to the specified column(s) of the specified data source. |
DataBindY(IEnumerable[])
将集合数据点的 Y 值绑定到指定数据源第一列的数据。Data binds the Y-value(s) of the collection's data points to the first column of the specified data source(s).
public:
void DataBindY(... cli::array <System::Collections::IEnumerable ^> ^ yValue);
public void DataBindY (params System.Collections.IEnumerable[] yValue);
member this.DataBindY : System.Collections.IEnumerable[] -> unit
Public Sub DataBindY (ParamArray yValue As IEnumerable())
参数
- yValue
- IEnumerable[]
一个或多个逗号分隔列表,其中列出了 IEnumerable<T> 数据源。One or more comma-separated IEnumerable<T> data sources.
注解
此方法将集合中数据点的 Y 值 (s) 绑定到指定数据源 () 的第一列。This method binds the Y-value(s) of the data points in the collection to the first column of the specified data source(s).
若要将 Y 值绑定到不是第一个可用列的数据源列,请使用 DataBindY 方法。To bind Y-values to a data source column that is not the first available column, use the DataBindY method.
可以通过使用参数指定多个数据源来绑定多个 Y 值 yValue 。You can bind several Y-values by specifying multiple data sources, using the yValue parameter. 请注意,每个数据源中的第一个可用列将用于每个数据点的连续 Y 值。Note that the first available column in each data source will be used for each data point's successive Y-values. 例如,第一个数据源的第一列 IEnumerable<T> 将绑定到数据点的第一个 y 值,第二个数据源的第一列 IEnumerable<T> 将绑定到数据点的第二个 y 值等。For example, the first column of the first IEnumerable<T> data source will be bound to the first Y-value of data points, the first column of the second IEnumerable<T> data source will be bound to the second Y-value of data points, and so forth.
如果数据源未提供 Y 值,或者如果提供的值的数目不正确,则将引发异常。If Y-values are not provided by the data source, or if the wrong number of values are provided, an exception will be thrown.
下面列出了可以用作数据源参数的对象:The following is a list of objects that you can use as the data source parameter:
下面列出了可以用作数据源的对象:The following is a list of objects that you can use as the data source:
DataViewDataView
数据读取器 (SQL、OleDB) Data readers (SQL, OleDB)
数组Arrays
列表Lists
使用接口的所有其他对象 IEnumerable<T> 。All other objects that use the IEnumerable<T> interface.
适用于
DataBindY(IEnumerable, String)
将数据点的 Y 值绑定到指定数据源的指定列的数据。Data binds the Y-value(s) of the data points to the specified column(s) of the specified data source.
public:
void DataBindY(System::Collections::IEnumerable ^ yValue, System::String ^ yFields);
public void DataBindY (System.Collections.IEnumerable yValue, string yFields);
member this.DataBindY : System.Collections.IEnumerable * string -> unit
Public Sub DataBindY (yValue As IEnumerable, yFields As String)
参数
- yValue
- IEnumerable
一个 IEnumerable<T> 数据源对象,该对象提供 Y 值。An IEnumerable<T> data source object that provides the Y-value(s).
- yFields
- String
向其绑定数据点的数据源字段。The data source field(s) to which to bind data point(s). 请注意,若要在列名称中嵌入逗号,可以使用双逗号。Note that a comma can be embedded as part of a column name, by using a double comma.
注解
此方法将集合中的数据点的 Y 值绑定到数据源 (s) 的指定字段。This method binds the Y-values of the data points in the collection to the specified fields(s) of the data source.
若要仅绑定到数据源中的第一个字段,请使用 DataBindY 方法。To bind only to the first field in a data source, use the DataBindY method.
可以通过将 yFields 参数设置为多个以逗号分隔的字段名称来绑定到多个字段。You can bind to several fields by setting the yFields parameter to multiple field names that are comma-separated. 请注意,第一个字段将用于数据点的第一个 Y 值,第二个命名字段将用于数据点的第二个 Y 值等。Note that the first field will be used for the data point's first Y-value, the second named field will be used for the data point's second Y-value, and so forth.
如果数据源未提供 Y 值,或提供的值的数目不正确,则将引发异常。If Y-values are not provided by the data source, or the wrong number of values are provided, an exception will be thrown.
下面列出了可以用作数据源的对象:The following is a list of objects that you can use as the data source:
DataViewDataView
数据读取器 (SQL、OleDB) Data readers (SQL, OleDB)
数组Arrays
列表Lists
使用接口的所有其他对象 IEnumerable<T> 。All other objects that use the IEnumerable<T> interface.