asp.net - Production environment not fetching sql data set -
my asp.net code not fetching data set sql database in production environment. code return no records, same code working fine in development environment. have feed crystal report fetched data set.
here code:
private sub generatereport1(sql1 string) dim crreportdocument = new crystaldecisions.crystalreports.engine.reportdocument() try dim reportname string = "kpiestoverallreport.rpt" dim ds new dataset() ds = getdataset(sql1) 'ds = dataaccesshelper.dataaccess.executedataset(dataaccesshelper.dataaccess.connectionstring, "usp_bms_kpi_estimation_performance_report ", commandtype.storedprocedure, param) session("dscrstalreport") = ds crreportdocument.filename = server.mappath("~//kpiestoverallreport.rpt") crreportdocument.setdatasource(ds) session("reportdoc") = crreportdocument if ds isnot nothing andalso ds.tables(0).rows.count > 0 scriptmanager.registerstartupscript(me, gettype(string), "showreport", "window.open('crystalreportviewer.aspx?','_blank','');", true) else lblmsg.text = "no records found..!" 'scriptmanager.registerstartupscript(me, gettype(string), "no records found.", "alert('no records found.');", true) end if catch ex exception lblmsg.text = ex.message end try end sub
you code not provide enough information on issue.
if simplify code get
dim ds new dataset() ds = getdataset(sql1) if (ds isnot nothing andalso ds.tables(0).rows.count > 0) false lblmsg.text = "no records found..!" end if
where "no records found..!" because either ds nothing or tables(0) has no recods.
this happen when sql1 returns no records or have error in getdataset method return nothing.
to troubleshoot, need debug getdataset() , see does.
Comments
Post a Comment