Anjana

Anjana

  • NA
  • 5
  • 6.2k

Not enough storage exception

Sep 3 2013 3:02 AM

Hi,

I am trying to convert XML data to excel file,but i am getting the below exception.

Unable to evaluate the expression. Not enough storage is available to complete this operation. Below is the code i am using.

public static string GetExcelXml(DataSet dsInput, string filename)

{

var excelTemplate = getWorkbookTemplate();

var worksheets = getWorksheets(dsInput);

var excelXml = string.Format(excelTemplate, worksheets);

return excelXml;

}

public static void ToExcel(DataSet dsInput, string filename, HttpResponse response)

{

response.Clear();

var excelXml = GetExcelXml(dsInput, filename);

response.AppendHeader(

"Content-Type", "application/vnd.ms-excel");

response.AppendHeader(

"Content-disposition", "attachment; filename=" + filename);

response.Write(excelXml);

response.Flush();

response.End();

}

Please provide a solution for this...