0

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.

2
Contributors
1
Reply
8
Views
3 Years
Discussion Span
Last Post by |-|x
0

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))

Edited by |-|x: incorrect VB syntax

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.