Share via


ReportDataSource Constructor (String, Object)

Constructs a named data source with a value.

Namespace: Microsoft.Reporting.WebForms
Assembly: Microsoft.ReportViewer.WebForms (in microsoft.reportviewer.webforms.dll)

Syntax

'Declaration
Public Sub New ( _
    name As String, _
    dataSourceValue As Object _
)
'Usage
Dim name As String
Dim dataSourceValue As Object

Dim instance As New ReportDataSource(name, dataSourceValue)
public ReportDataSource (
    string name,
    Object dataSourceValue
)
public:
ReportDataSource (
    String^ name, 
    Object^ dataSourceValue
)
public ReportDataSource (
    String name, 
    Object dataSourceValue
)
public function ReportDataSource (
    name : String, 
    dataSourceValue : Object
)

Parameters

  • name
    The name of the data source.
  • dataSourceValue
    A value for the data source.

Remarks

Value may be an instance of DataTable, a IEnumerable value (for example, DataView or Array), or a IDataSource.

If this value is an instance of IEnumerable, all elements in the collection must be of the same type, and names of the public properties of the element (as retrieved by the GetProperties method) must match the field names of the corresponding report data source.

Value may also be an instance of Type. In this case, an instance of the supplied type is automatically created and added to an automatically created collection.

If the type of Value is not any of the aforementioned types, it is added to an automatically created collection.

Example

Please see LocalReport for code examples.

See Also

Reference

ReportDataSource Class
ReportDataSource Members
Microsoft.Reporting.WebForms Namespace