how to rebind dataset,after changing stored procedure

Last post 05-10-2008 5:34 AM by vrparekh@gmail.com. 5 replies.

Sort Posts:

  • how to rebind dataset,after changing stored procedure

    05-09-2008, 4:07 AM

    in our project we r using .rdlc file for reporting purpose.

    now for one report, there is no dataset as .xsd file.(this is done by my senior who left.)

    and they written code for that and manually create dataset ,below is the code

    private static void ReportDSR(ReportViewer RV, string fromDt,string toDt, string empId)

    {

    Lib.DB.DataService DBSrv = new CatNetLib.DB.DataService(System.Web.Configuration.WebConfigurationManager.ConnectionStrings["ConnectionString"].ToString());

    DataSet RepDS = DBSrv.GetDataSet("Rep_GetDSCDataByEmpDateCity", // this is the name of stored procedure

    DBSrv.BP("FromDT", Lib.CLib.ConvDtUni(fromDt)), // and this is the parameter passed to it

    DBSrv.BP("ToDT", Lib.CLib.ConvDtUni(toDt)),

    DBSrv.BP("EmpID", empId));

    RV.Height = Unit.Pixel(475);

    RV.LocalReport.DataSources.Clear();

    RepDS.Tables[0].TableName =
    "DataSetAHB_DataTableAHB";

    RV.LocalReport.DataSources.Add(

    new ReportDataSource(RepDS.Tables[0].TableName, RepDS.Tables[0]));

    ReportParameter[] RP = new ReportParameter[2];

    RP[0] = new ReportParameter("RP_FromDate", Lib.CLib.ConvDtUni(fromDt).ToShortDateString());RP[1] = new ReportParameter("RP_ToDate", Lib.CLib.ConvDtUni(toDt).ToShortDateString());

    RV.LocalReport.SetParameters(RP);

    }

     

    now when in .rdlc file i click on "Report" menu and click on "report data sorce" , then that dataset is there in report dataset but i can not found that dataset in list (in dropdownlist-to add dataset in report).

    for one changes i add one field to stored procedure, now i want to display that field in report that's why i want to rebind that dataset but i could not find way

    because there is no .xsd file or dataadapter so i can do that, now how can i solve this problem.

    plz help me

    thanks.

  • Re: how to rebind dataset,after changing stored procedure

    05-09-2008, 7:52 AM
    • Loading...
    • sasi.k
    • Joined on 03-26-2007, 8:27 AM
    • Posts 192

    Hi,

        The RDLC is designed from .xsd typed dataset only.So create a typed dataset with required columns and add as a datasource in rdlc file. This is for designing purpose only don't worry about that dataset binding from code behind. 

     

    Regards,
    Sasi

    Please remember to click "Mark as Answer" on this post if it helped you.
  • Re: how to rebind dataset,after changing stored procedure

    05-09-2008, 8:13 AM

    thanks for reply,

    but even though currently there is no .xsd dataset, it works perfect.

    so i dont want to create xsd file and given to rdlc file if i can do that from without it,and using above code.

    thanks

  • Re: how to rebind dataset,after changing stored procedure

    05-09-2008, 8:24 AM
    Answer
    • Loading...
    • sasi.k
    • Joined on 03-26-2007, 8:27 AM
    • Posts 192

    yes you are correct , but you need add one more new columns am i right? for that purpose create xsd file with same structure with newly added columns,

    for adding in rdlc only. once you designed i.e added new column in report file.. exclude the xsd file from solution. and rebuild the application. or permananenly

    remove it.

    Regards,
    Sasi

    Please remember to click "Mark as Answer" on this post if it helped you.
  • Re: how to rebind dataset,after changing stored procedure

    05-09-2008, 10:39 AM

    ok,i am going to try it,

    thanks

  • Re: how to rebind dataset,after changing stored procedure

    05-10-2008, 5:34 AM

    thanks sasi, it is working perfect, i create one .xsd file, take the field which i had added and then delete the .xsd

    and it is working fine

    thanks a lot.

    vishal parekh

Page 1 of 1 (6 items)