TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
jeevan mummadi
NA
157
0
system out of memory exception occured when data export to excel from grid.
Jun 23 2011 1:44 AM
Hi All,
my grid consist of 40,000+ rows with 22 columns, and i am exporting grid data to excel programtically.
But i am getting system out of memory exception.
I am using this below code to export data from grid.
Code :
Response.Clear();
int j = 0;
//Add headers of the exported file
foreach (Column col in gvJob.Columns)
{
if (j > 0)
{
Response.Write(",");
}
Response.Write(col.HeaderText);
j++;
}
//How add the data from the Grid to exported file
for (int i = 0; i < gvJob.Rows.Count; i++)
{
Hashtable dataItem = gvJob.Rows[i].ToHashtable();
j = 0;
Response.Write("\n");
foreach (Column col in gvJob.Columns)
{
if (j > 0)
{
Response.Write(",");
}
//Response.Write(dataItem[col.DataField].ToString());
Response.Write(Convert.ToString( dataItem[col.DataField]));
j++;
}
}
// Send the data and the appropriate headers to the browser
Response.AddHeader("content-disposition", "attachment;filename=gvJob.csv");
Response.ContentType = "text/csv";
Response.End();
Is there any way to fix this issue, Please Help me.
Regards,
Jeevan.
Reply
Answers (
1
)
Play swf file in website using asp.net c#
How to create a VB.NET softphone?