Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5994777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:51:57+00:00 2026-05-22T23:51:57+00:00

var q = from n in XElement.Load(Application.StartupPath + ..\\..\\..\\2.xml).Elements() select n; foreach (var q0

  • 0
            var q = from n in XElement.Load(Application.StartupPath + "..\\..\\..\\2.xml").Elements()
                    select n;
            foreach (var q0 in q)
            {
                string str = q0.ToString();
            }

the problem is my xml file is so big so how I can manage this code to load it gradually not completely. now I traced by c# it loads all file completely in “q” and then loads some big nodes in “str”. I have limited memory and I need loading from file a little by little. I dont know how many nodes I have but I know general structure of file.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T23:51:58+00:00Added an answer on May 22, 2026 at 11:51 pm

    Instead of reading the whole XML file in memory at once and then iterating over it, check out the XmlReader class and its derivatives. These allow you to traverse your XML node per node.

    XmlTextReader is a particular derivative for reading XML from text files.

    Check out http://support.microsoft.com/kb/307548.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following XML Parsing code in my application: public static XElement Parse(string
The task is to convert the CSV file into XML. var x = from
I am trying to load data from XML string into a structure of some
var entries = from video in Video.GetTopVideos().AsEnumerable() select new XElement(item, new XElement(title, video.Title), new
I've got a problem when I'm calling a static var from another class. I
var cityList = from country in doc.Element(result) .Element(cities) .Descendants(city) select new { Name =
I'm using Linq to parse a simple XML file into a var (ienumerable), I'm
I have this XML file that I parse into its elements and create a
var count = (from p in xmlDoc.Descendants(env:SE04Overprinting) select p).Count(); throws an exception (kind of,
I parse an xml results from a webservice using linq : XElement items =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.