I want read a large dblp.xml file in c# because its a huge file, which can not load into memory. I query to take some data from this huge file. how can i read/get it.  &lt;phdthesis mdate="2012-04-18" key="phd/tw/Chang2008"&gt;   &lt;author&gt;Fengming Chang&lt;/author&gt;   &lt;title&gt;Learning accuracy from limited data: &lt;/title&gt;   &lt;year&gt;2008&lt;/year&gt;   &lt;school&gt;Tainan, National Cheng Kung Univ.&lt;/school&gt;   &lt;pages&gt;1-67&lt;/pages&gt;   &lt;isbn&gt;978-3-8364-8603-3&lt;/isbn&gt;   &lt;note type="dnb"&gt;http://d-nb.info/989267156&lt;/note&gt; &lt;/phdthesis&gt;   How can i read from a huge xml file using c# not loading all xml file in memory?
122799
I'm writing a GIS client tool in C# to retrieve "features" in a GML-based XML schema (sample below) from a server. Extracts are limited to 100,000 features.  I guestimate that the largest extract.xml might get up around 150 megabytes, so obviously DOM parsers are out I've been trying to decide between  and  generated bindings --OR--  and a hand-crafted object graph.  Or maybe there's a better way which I haven't considered yet? Like XLINQ, or ????  Please can anybody guide me? Especially with regards to the memory efficiency of any given approach. If not I'll have to "prototype" both solutions and profile them side-by-side.   I'm a bit of a raw prawn in .NET. Any guidance would be greatly appreciated.   Thanking you. Keith.    Sample XML - upto 100,000 of them, of upto 234,600 coords per feature.  &lt;feature featId="27168306" fType="vegetation" fTypeId="1129" fClass="vegetation" gType="Polygon" ID="0" cLockNr="51598" metadataId="51599" mdFileId="NRM/TIS/VEGETATION/9543_22_v3" dataScale="25000"&gt;   &lt;MultiGeometry&gt;     &lt;geometryMember&gt;       &lt;Polygon&gt;         &lt;outerBoundaryIs&gt;           &lt;LinearRing&gt;             &lt;coordinates&gt;153.505004,-27.42196 153.505044,-27.422015 153.503992 .... 172 coordinates omitted to save space ... 153.505004,-27.42196&lt;/coordinates&gt;           &lt;/LinearRing&gt;         &lt;/outerBoundaryIs&gt;       &lt;/Polygon&gt;     &lt;/geometryMember&gt;   &lt;/MultiGeometry&gt; &lt;/feature&gt;
114316
I'm trying to read an Excel file (Office 2003). There is an Excel file that needs to be uploaded and its contents parsed.  Via Google, I can only find answers to these related (and insufficient topics): generating Excel files, reading Excel XML files, reading Excel CSV files, or incomplete abandoned projects. I own Office 2003 so if I need any files from there, they are available. It's installed on my box but isn't and can't be installed on my shared host.  Edit: so far all answers point to  and/or  about how to use it.
92432
I want to both read from and write to a file. This doesn't work.   static void Main(string[] args) {     StreamReader sr = new StreamReader(@"C:\words.txt");     StreamWriter sw = new StreamWriter(@"C:\words.txt"); }   How can I both read from and write to a file in C#?
63258
I want to write a program in C/C++ that will dynamically read a web page and extract information from it. As an example imagine if you wanted to write an application to follow and log an ebay auction. Is there an easy way to grab the web page? A library which provides this functionality? And is there an easy way to parse the page to get the specific data?
115022
I am trying to access settings in my config file, which is a series of xml elements listed as such:  &lt;databases&gt; &lt;database name="DatabaseOne" Value="[value]" /&gt; &lt;database name="DatabaseTwo" Value="[value]" /&gt; &lt;/databases&gt;   Now I want to access it. I have set up classes like so:  Public Class DatabaseConfigurationHandler     Inherits ConfigurationSection      &lt;ConfigurationProperty("Databases", IsDefaultCollection:=True)&gt; _    Public ReadOnly Property Databases() As DatabaseCollection         Get             Return CType(Me("Databases"), DatabaseCollection)         End Get     End Property End Class  Public Class DatabaseCollection     Inherits ConfigurationElementCollection      Protected Overloads Overrides Function CreateNewElement() As ConfigurationElement         Return (New Database())     End Function      Protected Overloads Overrides Function GetElementKey(ByVal element As ConfigurationElement) As Object         Return (CType(element, Database).DatabaseName)     End Function  End Class  Public Class Database     Inherits ConfigurationElement      &lt;ConfigurationProperty("name", IsKey:=True, IsRequired:=True)&gt; _        Public Property DatabaseName() As String         Get             Return Me("name").ToString()         End Get         Set(ByVal Value As String)             Me("name") = Value         End Set     End Property       &lt;ConfigurationProperty("value", IsRequired:=True)&gt; _ Public Property DatabaseValue() As String         Get             Return Me("value").ToString()         End Get         Set(ByVal Value As String)             Me("value") = Value         End Set     End Property  End Class   I want to be able get the element by it's name and return the value but I can't see to do that:  Dim config As New DatabaseConfigurationHandler                 config = System.Configuration.ConfigurationManager.GetSection("databases/database")                 Return config.Databases("DatabaseOne")   Am I missing some code, what am I doing wrong? Any other errors in the above?  Thanks.
82189
How can I list the contents of a zipped folder in C#? For example how to know how many items are contained within a zipped folder, and what is their name?
33533
I have this as xml:  &lt;root xmlns:event="http://www.webex.com/schemas/2002/06/service/event"&gt;     &lt;event:event&gt;         &lt;event:sessionKey&gt;&lt;/event:sessionKey&gt;         &lt;event:sessionName&gt;Learn QB in Minutes&lt;/event:sessionName&gt;         &lt;event:sessionType&gt;9&lt;/event:sessionType&gt;         &lt;event:hostWebExID&gt;&lt;/event:hostWebExID&gt;         &lt;event:startDate&gt;02/12/2009&lt;/event:startDate&gt;         &lt;event:endDate&gt;02/12/2009&lt;/event:endDate&gt;         &lt;event:timeZoneID&gt;11&lt;/event:timeZoneID&gt;         &lt;event:duration&gt;30&lt;/event:duration&gt;         &lt;event:description&gt;&lt;/event:description&gt;         &lt;event:status&gt;NOT_INPROGRESS&lt;/event:status&gt;         &lt;event:panelists&gt;&lt;/event:panelists&gt;         &lt;event:listStatus&gt;PUBLIC&lt;/event:listStatus&gt;     &lt;/event:event&gt;     ... &lt;/root&gt;   How can I loop through all of the event:event nodes and display, for example, all of the event:SessionKey's?   This does not work:  $xml = new SimpleXMLElement($r); $xml-&gt;registerXPathNamespace('e', 'http://www.webex.com/schemas/2002/06/service/event');  foreach($xml-&gt;xpath('//e:event') as $event) {  var_export($event-&gt;xpath('//e:sessionKey')); }
68176
I've been working on database-driven web applications for a few years now and recently took on a project involving a CMS that is XML-capable. This has led me to think about the usage of XML/XSLT in general and in what situations it would be more useful than the approach I've always used, which is storing all of my data in a (My)SQL database and then using PHP/Python/etc. to work with it on the web as needed.  There's obviously something I'm not "getting" here.. could anyone give me examples of applications where storing the data in XML files instead of in a database would be preferable?
50127
What would be the most efficient method of reading a text file into a dynamic one-dimensional array? reallocing after every read char seems silly, reallocing after every read line doesn't seem much better. I would like to read the entire file into the array. How would you do it?
39815
Is there a free or open source library to read Excel files (.xls) directly from a C# program?   It does not need to be too fancy, just to select a worksheet and read the data as strings. So far, I've been using Export to Unicode text function of Excel, and parsing the resulting (tab-delimited) file, but I'd like to eliminate the manual step.
39706
Can someone point me to a good tutorial explaining the Entity Framework using an XML file instead of a database? I have seen some good tutorials with SQL databases, but I can't make the leap to an XML file.  Thanks!
119910
I'm using .NET 3.5 and would like to be able to obtain every *n*th item from a List.  I'm not bothered as to whether it's achieved using a lambda expression or LINQ.  Edit  Looks like this question provoked quite a lot of debate (which is a good thing, right?).  The main thing I've learnt is that when you think you know every way to do something (even as simple as this), think again!
68167
I'm loading an XML document in my C# application with the following:  XDocument xd1 = new XDocument(); xd1 = XDocument.Load(myfile);   but before that, I do test to make sure the file exists with:  File.Exists(myfile);   But... is there an (easy) way to test the file before the XDocument.Load() to make sure it's a valid XML file?  In other words, my user can accidentally click on a different file in the file browser and trying to load, say, a .php file causes an exception.    The only way I can think of is to load it into a StreamWriter and simple do a text search on the first few characters to make sure they say "  Thanks!  -Adeena
77208
I've discovered that cElementTree is about 30 times faster than xml.dom.minidom and I'm rewriting my XML encoding/decoding code. However, I need to output XML that contains CDATA sections and there doesn't seem to be a way to do that with ElementTree.  Can it be done?
74479
I am not as familiar with Oracle as I would like to be.  I have some 250k records, and I want to display them 100 per page.  Currently I have one stored procedure which retrieves all quarter of a million records to a dataset using a data adapter, and dataset, and the dataadapter.Fill(dataset) method on the results from the stored proc.  If I have "Page Number" and "Number of records per page" as integer values I can pass as parameters, what would be the best way to get back just that particular section.  Say, if I pass 10 as a page number, and 120 as number of pages, from the select statement it would give me the 1880th through 1200th, or something like that, my math in my head might be off.    I'm doing this in .NET with C#, thought that's not important, if I can get it right on the sql side, then I should be cool.   Update:  I was able to use Brian's suggestion, and it is working great.  I'd like to work on some optimization, but the pages are coming up in 4 to 5 seconds rather than a minute, and my paging control was able to integrate in very well with my new stored procs.
114705
I am trying to determine the size in bytes of the contents in a VARBINARY(MAX) field in SQL Server 2005, using SQL. As I doubt there is native support for this, could it be done using CLR integration? Any ideas would be greatly appreciated.
67131
Its a .vbproj and looks like this  &lt;Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt;     &lt;PropertyGroup&gt;         &lt;ProjectGuid&gt;15a7ee82-9020-4fda-a7fb-85a61664692d&lt;/ProjectGuid&gt;   all i want to get is the ProjectGuid but it does not work when a namespace is there...   Dim xmlDoc As New XmlDocument()  Dim filePath As String = Path.Combine(mDirectory, name + "\" + name + ".vbproj")  xmlDoc.Load(filePath)  Dim value As Object = xmlDoc.SelectNodes("/Project/PropertyGroup/ProjectGuid")   what can i do to fix this?