Hi <BR>I am exporting the data to excel.If i have huge data its giving memroy error means it creates an enormous amount of objects in memory and the .Net framework restarts the asp.net process to prevent it from eating all the server&#039;s memory. <BR>This means that all asp.net applications running on that server would be restarted (loosing connections, sessions data...) <BR><BR>log shows below error<BR>aspnet_wp.exe (PID: 2616) was recycled because memory consumption exceeded the 305 MB (60 percent of available RAM).<BR><BR>my code is <BR><BR><BR> Dim adapter As New SqlDataAdapter(sql, con) &#039;<BR> Dim myDataSet As New DataSet<BR> Try<BR> adapter.Fill(myDataSet, "ds")<BR> Catch ex As Exception<BR><BR> End Try<BR><BR> Response.Clear()<BR> Response.Charset = ""<BR> Response.ContentType = "application/vnd.ms-excel" &#039; set the content type <BR> Response.AddHeader("Content-Disposition", " attachment; filename=urreportname.xls")<BR> Dim stringWrite As New System.IO.StringWriter<BR> Dim htmlWrite As New System.Web.UI.HtmlTextWriter(stringWrite)<BR> Dim dg As New System.Web.UI.WebControls.DataGrid<BR> dg.DataSource = myDataSet.Tables(0) &#039; it is here where u need to assign ur datatable <BR> dg.DataBind()<BR> dg.RenderControl(htmlWrite)<BR> Response.Write(stringWrite.ToString)<BR> Response.End()<BR>