locked
reportviewer and stored procedure problem RRS feed

  • Question

  • User-1176988413 posted

    //SqlConnection conn =

            SqlCommand cmd = new SqlCommand();
            cmd.Connection = cmm.getcon();
            cmd.CommandText = "seeker_applied";
            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.Add("@jobid", SqlDbType.Int).Value = DropDownList1.SelectedValue;

            SqlDataAdapter da = new SqlDataAdapter(cmd);

            /* Initializing the object of Dataset created in the project */
            seekerapplied cust = new seekerapplied();
            //dad.SelectCommand = cmd;

            da.Fill(cust, cust.seeker_applied.TableName);

            this.ReportViewer1.LocalReport.DataSources.Clear();


            /***************************************************************/
            /***************************************************************
            /* setting up the report data source for the report called..****/
            /***************************************************************/
            /***************************************************************/

            ReportDataSource rds = new ReportDataSource();
            rds.Name = "seeker_dataset";   //name of the dataset that you created in the report
            rds.Value = cust.seeker_applied;

            this.ReportViewer1.LocalReport.DataSources.Add(rds);

            this.ReportViewer1.LocalReport.ReportPath = "Report3.rdlc";   //path of the report to be called
            this.ReportViewer1.LocalReport.Refresh();

    ============

    stored procedure

    create procedure [dbo].[seeker_applied]
    (
        @jobid int
    )

    as    

    if @jobid = 0
    begin
        select b.username,b.emailid,b.studentid,b.phone,b.salary,b.skills,b.totexp,b.desposition,c.job_title
        from jobseeker_respond_to_recuiter a
        inner join jobseeker_account_detail b on a.jobseekerid = b.studentid
        inner join job_opening_detail c on c.job_id = a.jobid
    end
    else begin
        select b.username,b.emailid,b.studentid,b.phone,b.salary,b.skills,b.totexp,b.desposition,c.job_title
        from jobseeker_respond_to_recuiter a
        inner join jobseeker_account_detail b on a.jobseekerid = b.studentid
        inner join job_opening_detail c on c.job_id = a.jobid
        where a.jobid = @jobid
    end

    what error in this ??

    when i run it return nothing

    when i debug and it was return

    http://i.imgur.com/CgHDU.png

    but in report viewer it shows nothing :(

    Wednesday, October 10, 2012 12:34 PM

Answers

All replies