Hi alll..
How to handle huge volume of data ( more than 10 lakhs records) ??
Requirement - In database (either Oracle or SQL Server ), I want a facility such that more than 5 lakhs records be inserted , and can be displayed in gridview.
Loading huge amount of records is causing SQL Server Error - "Time Expired".
One option is database-level paging using Row_number() function with page index and page size.
But, one more requirement is - on button click, I want all these records to be exported to excel..
How do I do this ?
Also, How do we handle this large volume of data in LINQ ??
PLease guide
Loading
Rahul ChavanPosted Apr 20, 2016, 6:07 AM
Riddhi ValechaPosted Apr 20, 2016, 2:24 AM
Posted Apr 16, 2016, 1:10 AM
Riddhi ValechaPosted Apr 14, 2016, 7:37 AM
For export to excel , on one button click event, I have to export 3 lakhs records at a time.
This is taking time (2-3mins) and still giving error -"Time Expired".
How do I do this ?
Also, I want solutions for all 3 ways of handling the huge amount of data...
Manas MohapatraPosted Apr 14, 2016, 7:00 AM
Riddhi ValechaPosted Apr 14, 2016, 6:22 AM
public override void VerifyRenderingInServerForm(Control ctrl)
{
return;
}
private string GetString(object o)
{
if (o == null)
return "";
return o.ToString();
}
private void ExportToExcel()
{
try
{
table = new DataTable();
table = (DataTable)Session["Data"];
if (table != null)
{
grdv = new GridView();
grdv.DataSource = table;
grdv.DataBind();
Response.Clear();
Response.Buffer = true;
Response.ContentType = "application/vnd.ms-excel";
Response.AddHeader("content-disposition", "attachment;filename=Employee Report.xls");
Response.Charset = "";
this.EnableViewState = false;
System.IO.StringWriter oStringWriter = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter oHTMLTextWriter = new System.Web.UI.HtmlTextWriter(oStringWriter);
grdv.RenderControl(oHTMLTextWriter);
Response.Write(oStringWriter.ToString());
Response.End();
}
}
catch (Exception err) { err.Message.ToString(); }
}
#endregion
Manas MohapatraPosted Apr 14, 2016, 1:12 AM