Hello all,

I am having an issue learning some things in visual studio 2013 asp.net using vb. I am following a fellows instruction on doing a report with a parameter. In this part of the code: Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

        ReportViewer1.Visible = True

        Dim thisDataSet As New DataSet()

        Dim adapCity As USACityTableAdapters.mCityTableAdapter = New USACityTableAdapters.mCityTableAdapter
        Dim DS As USACity.mCityDataTable = New USACity.mCityDataTable
        adapCity.Fill(DS, Me.DropDownList1.SelectedValue)


        Dim datasource As New ReportDataSource("USACity_mCity", DS)
        ReportViewer1.LocalReport.DataSources.Clear()
        ReportViewer1.LocalReport.DataSources.Add(datasource)

        ReportViewer1.LocalReport.Refresh()
    End Sub

The issues is with "Dim datasource As New ReportDataSource("USACity_mCity", DS). The Error message says "overload resolution failed because no accessible new is most specific for these arguments.”

I am an extreme newbie and am looking for anytype of guidance in what my problem could possibly be.

Thanks in advance.

You could try casting the datasource table you are passing in as an object (it could be just a resolution issue with the constructor definition expecting an object type, even though theoretically anything is an object).

Dim datasource As New ReportDataSource("USACity_mCity", CType(DS, Object))
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.