Blue Theme Orange Theme Green Theme Red Theme
 
Nevron Gauge for SharePoint
Home | Forums | ASP.NET 2.0 Tutorials | Web Services | How Do I...? | Class Browser | WPF Quick Starts | Advertise with Us
 | Consulting  
Submit an Article Submit a Blog 
Search :       Advanced Search »
Mindcracker Member - nitin singla
LATEST ACTIVITIES ARTICLESBLOGSFORUMSNEWSRESOURCESDOWNLOADSINTERVIEWSVIDEOS
 nitin singla
nitin singla's Image
In application there is a utility to export data from database to XML file and then import the same in another system. The system is designed using .NET Framework 3.5. The utility fails when trying to export the data around 100000 rows in table. Out of memory exception is raised The code snippet is as follows private void ExportTableAsXml(ref XmlNode rootElement,Hashtable externalParameters) { DataTable result = null; if (commandTypeField == CommandType.StoredProcedure) { } else if (commandTypeField == CommandType.Text) { DataSet resultDataSet = xdo.ExecDataSetSQL(sqlStatementField); if (resultDataSet != null && resultDataSet.Tables.Count > 0) result = resultDataSet.Tables[0]; } XmlNode containerElement = rootElement; if (result != null && result.Rows.Count != 0) { if (containerNameField != string.Empty) containerElement = rootElement.OwnerDocument.CreateElement(containerNameField); if (!ResultIsXml) ConvertTableToXml(ref containerElement, result); else { StringBuilder xmlBuilder = new StringBuilder(); if (result.Columns.Count == 1) { foreach(DataRow row in result.Rows) { if (!row.IsNull(result.Columns[0])) { xmlBuilder.Append(row[0]); }
Contributions
Articles (0)
Blogs (1)
Forum Posts (0)
Downloads (0)
Book Chapters (0)
News & Resources (0)
Tutorials (0)
Photos (0)
Videos (0)
Interview Questions (0)



 PROFILE
Country:
Expertise:
 My Prizes  
No Prize Found
 PHOTO GALLERY  
No photo available
 FRIENDS LIST  
0 Friends
 MY FOLLOWERS 
No follower at the moment
 FOLLOWING 
Not following anyone
Featured E-book
Browse more books here»
This section is sponsored by
Nevron Gauge for SharePoint
Team Foundation Server Hosting
 © 2012  contents copyright of their authors. Rest everything copyright Mindcracker. All rights reserved.