1
Vote

Exception is raised in IE while writing record

description

Hi,

Am having the following code , and though this works in FF and Chrome fine , for IE IIS7 getting the following error:
Exception: System.Web.HttpException (0x800704CD): The remote host closed the connection. The error code is 0x800704CD.

Exception: System.Web.HttpException (0x800704CD): The remote host closed the connection. The error code is 0x800704CD.
at System.Web.Hosting.IIS7WorkerRequest.RaiseCommunicationError(Int32 result, Boolean throwOnDisconnect)
at System.Web.Hosting.IIS7WorkerRequest.ExplicitFlush()
at System.Web.HttpResponse.Flush(Boolean finalFlush, Boolean async)
at System.Web.HttpWriter.Write(String s)
at ClinicalAdvantage.Web.Controllers.DischargeListing.DischargeListingController.ExportToCsv(Int32 measureId, Int32 hospitalId, String tableRowId, Int32 targetId, MeasureTargetType targetType, DischargeType dischargeType, DischargeDrilldown drilldown, String orderSetName, String orderItemOrKey, String orderItemKey, String orderItemAndKey, Int32 cdmKey, InsightGrouping filterType, Int32 filterGroupingId, Boolean secondVisit, Int32 secondfilterId, Boolean consultantCharges, List`1 selectedDischargeIds, Boolean allDischarges, DischargeListingType listingType, String search) in e:\CCCUsers\Dhanya\Dhanya_CCC_86086\ClinicalAdvantage.Web\Controllers\DischargeListing\DischargeListingController.cs:line 692
at lambda_method(Closure , ControllerBase , Object[] )

This is the code:

using (var csvHelper = new CSVHelper(Response.OutputStream))
            {

                IEnumerable<string> headerColumns = null;

                foreach (var discharColection in dischargeDetails)
                {
                    foreach (var dischargeDetail in discharColection)
                    {
                        if (headerColumns == null)
                        {
                            headerColumns = GetHeaderColumns(focus, dischargeDetail, inPatient,
                                                                applicableCoreMeasures);
                            csvHelper.WriteRecord(headerColumns);
                        }
                        encounterNumbers.Add(dischargeDetail.EncounterNumber);
                        csvHelper.WriteRecord(GetDataValues(inPatient, dischargeDetail, headerColumns,
                                                            applicableCoreMeasures));
                    }
                }
                csvHelper.Flush();
            }

Any idea that why this is specific to IE ? Anything got to do with the flush method ?

comments