Hi I am Create a report with Crystal report 2008.
and try display this.

Dim rpt As New RptPurchase
Dim ta As New ReportDataSetTableAdapters.PBackTableAdapter
Dim dt As New ReportDataSet.PBackDataTable
ta.Fill(dt, Val(lblInvoiceNo.Text.Trim))
rpt.SetDataSource(dt)
..
..
..

But one error occured this time -

Error   1       Overload resolution failed because no accessible
'SetDataSource' is most specific for these arguments:
    'Public Overridable Sub SetDataSource(dataTable As
System.Data.DataTable)': Not most specific.
    'Public Overridable Sub SetDataSource(enumerable As
System.Collections.IEnumerable)': Not most specific.

Why this error occured ?

i change code to --> rpt.SetDataSource(CType(dt, DataTable))

then it work fine.
but my doubt is , the dt is already a datatable .then why produce
error ?
and dt convert datatable then work fine.
why ?

Reply via email to