DataPointCollection::DataBindY Method (IEnumerable, String)
Data binds the Y-value(s) of the data points to the specified column(s) of the specified data source.
Assembly: System.Web.DataVisualization (in System.Web.DataVisualization.dll)
Parameters
- yValue
- Type: System.Collections::IEnumerable
An IEnumerable<T>
data source object that provides the Y-value(s).
- yFields
- Type: System::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.
This method binds the Y-values of the data points in the collection to the specified fields(s) of the data source.
To bind only to the first field in a data source, use the DataBindY method.
You can bind to several fields by setting the yFields parameter to multiple field names that are comma-separated. 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.
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:
DataView
Data readers (SQL, OleDB)
Arrays
Lists
All other objects that use the IEnumerable<T> interface.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.