Condividi tramite


Costruttore ReportDataSource (String, Object)

Crea un'origine dati denominata con un valore.

Spazio dei nomi  Microsoft.Reporting.WinForms
Assembly:  Microsoft.ReportViewer.WinForms (in Microsoft.ReportViewer.WinForms.dll)

Sintassi

'Dichiarazione
Public Sub New ( _
    name As String, _
    dataSourceValue As Object _
)
'Utilizzo
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
)
new : 
        name:string * 
        dataSourceValue:Object -> ReportDataSource
public function ReportDataSource(
    name : String, 
    dataSourceValue : Object
)

Parametri

Osservazioni

Value può essere un'istanza di DataTable, un valore di IEnumerable (ad esempio DataView o Array) oppure un oggetto BindingSource.

Se questo valore è un'istanza di IEnumerable, tutti gli elementi della raccolta devono essere dello stesso tipo e i nomi delle proprietà pubbliche dell'elemento (come recuperati dal metodo GetProperties()) devono corrispondere ai nomi dei campi dell'origine dati corrispondente del rapporto.

Value potrebbe anche essere un'istanza di Type. In questo caso, un'istanza del tipo specificato viene creata automaticamente e quindi aggiunta a una raccolta creata automaticamente.

Se il tipo di Value non corrisponde a uno dei tipi indicati in precedenza, viene aggiunto a una raccolta creata automaticamente.

Esempi

Per alcuni esempi di codice, vedere LocalReport.

Vedere anche

Riferimento

ReportDataSource Classe

Overload ReportDataSource

Spazio dei nomi Microsoft.Reporting.WinForms