none
Error when Using Stored procedure in local reports RRS feed

  • Question

  • Hi all
    I am using Local reports in asp.net.I have added three different projects for one solution and named it as Pal,Bal,Dal three layers.
    I have added App_code folder in Business layer and added xsd file.
    And i am using following code for previewing the report

    Private Sub BTN_SUBMIT_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BTN_SUBMIT.Click

    Dim Bal As New Bal_Userdet

    Dim Struserid As String = DDL_USERIDS.SelectedValue

    'Bal.ViewReport(Struser

    Dim conn As New SqlConnection(Connstr)

    Try

    conn.Open()

    Dim rep As LocalReport = ReportViewer1.LocalReport

    rep.ReportPath = System.AppDomain.CurrentDomain.BaseDirectory & "Reports\Userdisplay.rdlc"

    Dim ds As New ReportDataSource()

    Dim da As New SqlDataAdapter

    Dim cmd As SqlCommand = New SqlCommand("USERSFORREPORT", conn)

    cmd.CommandType = CommandType.StoredProcedure

    cmd.Parameters.AddWithValue("@USERID", Struserid)

    da.SelectCommand = cmd

    da.Fill(myDataSet, "USERSFORREPORT")

    ds.Name = "Userdet_USERSFORREPORT"

    ds.Value = myDataSet.Tables(0)

    rep.DataSources.Clear()

    rep.DataSources.Add(ds)

    ReportViewer1.LocalReport.Refresh()

    Catch ex As Exception

    Finally

    conn.Close()

    Bal = Nothing

    End Try

    End Sub


    But getting the following error.

    A data source instance has not been supplied for the data source 'USERSFORREPORT'.

    What is the problem.Any body help me


    Naren
    Saturday, February 7, 2009 1:44 PM

Answers

All replies