How to MoveFirst, MoveNext, MovePrevious, MoveLast in LinQ To XMl Please Help

I have the Next XML

			var xml = new XElement( "clients",
			                       new XElement("client",
			                                    new XAttribute("id",1),
			                                    new XElement( "name", "Luis"),
			                                    new XElement( "country",
"Portugal")
			                                   ),
			                       new XElement("client",
			                                    new XAttribute("id",2),
			                                    new XElement( "name", "John"),
			                                    new XElement( "country",
"England")
			                                   ),
			                       new XElement("client",
			                                    new XAttribute("id",3),
			                                    new XElement( "name", "Edwin"),
			                                    new XElement( "country", "Costa
Rica")
			                                   ),
			                       new XElement("client",
			                                      new XAttribute("id",4),
			                                      new XElement( "name",
"Paulo"),
			                                      new XElement( "country",
"Portugal")
			                                     )

			                      );

And I nedd one code to move between nodes but Without use Foreach or
While, Only I Can do next.

			var firstClient = xml.Element("client");
			Debug.WriteLine(firstClient);
			var ancestor = firstClient.NextNode;
			Debug.WriteLine(ancestor);

But with this don`t move more than "id",2 Please Help


Thanks

Edcha
0
edchar (4)
11/3/2008 6:08:07 PM
dotnet.xml 7266 articles. 0 followers. Follow

0 Replies
1325 Views

Similar Articles

[PageSpeed] 44

Reply:

Similar Artilces:

Help Pls
Since installing Office 2003 SP-1 via Office Online, Outlook 2003 will not open. The error message is: Cannot start Microsoft Office Outlook. Unable to Open the Outlook Window. The set of folders could not be opened. Can someone help? I response, I uninstalled Office 2003 and reinstalled, to no avail. Resolve it myself, I do not think this problem will be general to anyone else, but here was the issue and the solution. I had installed SP-1 online after shutting down all Office programs, however I failed to realize that another application was still sharing Outlook files -- my PalmO...

Please help
I hope someone can help me out with this because it is creating a very big hassle for me. In the old 2000 version of Excel, it is possible to paste results directly from a Query Analyzer table (or any other table for that matter) into the spreadsheet. It would match the data cell for cell. However in 2003, it seems to paste the an entire multicolumn table of results to single column. Does anyone know how to fix this? Is it a setting or something in 2003? Any help at all is appreciated. Thanks, Joe Joe No setting as such that I know of. Don't have analyser installed but tried ...

Please help me recover this Exchange 5.5 data!
I don't know what or how it happened, but I have a user who has seemingly lost all their private store information. When I open up Exchange 5.5 Admin, it shows that there is 33,000+ items, but only taking up 40k of space. I don't quite see how that is possible....so I am assuming the data is there *somewhere* Before you tell me to restore from backup, this is a client of mine that did not do backups, and they have now started to (imagine that). Is this data lost forever? Or is it in a non-committed log or something like that? Where could Exchange possibly keep this data? Is...

repost help windows error
I have uninstalled reinstalled three times - different directories - complete shutdown and restarts to no avail --------------------------- Microsoft Visual C++ Runtime Library --------------------------- Runtime Error! Program: C:\Program Files\Microsoft Money\System\msmoney.exe abnormal program termination --------------------------- OK --------------------------- You can keep posting at 12 hour intervals and it will not make anybody more likely to know an answer to your issue. Note also that neither of your posts ever pose a question. This is not a common issue with a simple ans...

I'm a SQL Server newbie...need help with dates
I'm using SQL 2005 Dates in Access stored as date. Imported in SQL Server using import wizard. Goes into table as 8/6/2009 12:00:00 AM my query: sum(case when transaction_date between '08/01/09' and '08/31/09' then hours else 0 end) ap2, --i get 200 which is correct sum(case when transaction_date between '07/01/09' and '09/30/09' then hours else 0 end) apQ1, --i get 200 which is correct sum(case when transaction_date between '07/01/09' and '07/30/10' then hours else 0 end) total --I get 0 why am i getting 0? thank...

Passing Parameter to Transform of XML to XML
The following transformation puzzles me when trying to transform XML to XML. I get an exception "THE EXPRESSION PASSED TO THIS METHOD SHOULD RESULT IN A NODESET" at the last line "xmlDoc.Load(xr)" when I run the code. I previously tried it all without a parameter and hard-coded the value into the 'apply-templates' statement and the tranform produced the result that I expected but when I inset the parameter I get the exception. I would appreciate it if someone could look over the code and identify which part of the code causes the fault I use VB.NET 2003 and .NE...

Simple XML Log
I want to receive an XML document via an aspx page and log the raw xml to a text file. I've been looking at this for a while and can't work out how to do it. Can someone tell me how to grab the raw xml text (once I've got the text I can do the logging bit) Thanks HHoulston wrote: > I want to receive an XML document via an aspx page and log the raw > xml to a text file. I've been looking at this for a while and can't > work out how to do it. Can someone tell me how to grab the raw xml > text (once I've got the text I can do the logging bit)? Assumin...

XML >> XSL
Hi All! I'm completly green at using XML/XSL and have a small problem... I have a XML file that is generated by my application. It looks like this: <PLANETS> <PLANET> <NAME>Eartch</PLANET> <INFO> <COLOR>Blue</COLOR> <WEIGHT>168732372</WEIGHT> </INFO> </PLANET> <PLANET> <NAME>Mars</PLANET> <INFO> <COLOR>Red</COLOR> <WEIGHT>75894837857</WEIGHT> </INFO> </PLANET...

Custom PageSetup dialog & help
I have a custom PageSetupDialog - done by following steps recommended by MSDN. I have a custom dialog resource built by adding a few fields to the standard page setup dialog dialog resource, and have used the PSD_ENABLEPAGESETUPTEMPLATE flag to get my dialog. It all works as expected. My application has help files setup and I have handlers for the various help messages (ID_HELP, ID_HELP_INDEX, ID_CONTEXT_HELP etc.). When the application is running and you are at the custom page setup dialog and press the F1 key - a context help is displayed for all the fields that the standard Page setup...

Loading ".chm" help file
Hi all. I have an application in MFC Visual .NET which i want to load an help file. As default the ".HLP" help file is loaded and in order to load the ".chm" help file i overrided the WinHelp function in my CMainFrame class and call the HtmlHelp function in it. The code is: ::HtmlHelp(GetSafeHwnd(),"MyApp.chm",HH_DISPLAY_TOPIC,0); but it is not working. What am i doing wrong? Thanks for your help. Nir. In addition : It is working first, but if i open ?CFileDialog before the help, it is not working. I don't know if when the project was created, t...

Please help: Windows6.0-KB956250-v6001-x86.msu during .NET 4.0 ins
Please see this post in .NET setup forum for details: http://social.msdn.microsoft.com/Forums/en-US/netfxsetup/thread/e5067cb6-e5d1-44ab-a2df-33b52e79366f?prof=required I've been trying to install VS 2010 on my Vista laptop for weeks. It fails during .NET v4.0 install with the following error: Exe (C:\9e4eb1a408d61dd8118c98e39082f9\Windows6.0-KB956250-v6001-x86.msu) failed with 0x80040154 - Class not registered . I've taken many troubleshooting steps to try to resolve; most are listed in above forum link. Please let me know if you need more info. Thank you. -T ...

macro help #9
I have a workbook that has seven worksheets "open", "closed", "area1", "area2", "area3", "area4", "area5". On worksheet "open" each row will have a column range b2,b2000 labled "area" that I will be putting in one of the five areas (1-5). The "open" worksheet will also have another column range i2,i2000 listed as "active" which will have either a "y" or an "n". So this is what I need. 1. I need the entire row to copy and paste over to the corresponding worksheet ...

uninstall and reinstall outlook 2007 from Office pro disk???? help
for some reason outlook has thrown a wobbly and is telling me to reinstall (tried starting in safe mode but told me files were missing and again to reinstall) - however I cannot see how to do this via the office 2007 pro disk? Could someone help please? simple instructions, thank you! Insert Office cd, when it runs select Office Diagnostics (ie Repair/Reinstall) "mary" <mary@discussions.microsoft.com> wrote in message news:418A3AD0-56E4-4A6E-9E95-79E2DC44B58E@microsoft.com... > for some reason outlook has thrown a wobbly and is telling me to reinstall > ...

RDNS Help
Can someone post screen caps of an example of a correct setup for a Reverse Lookup Zone? I've tried all of the advice I can find and I still apparently can't do it right. I use DNSStuff.com to test and the result I get is: [A=None] *ERROR* There is no A record (may be cached) On Mon, 5 Jun 2006 13:28:02 -0700, CoastalGuy <CoastalGuy@discussions.microsoft.com> wrote: >Can someone post screen caps of an example of a correct setup for a Reverse >Lookup Zone? I've tried all of the advice I can find and I still apparently >can't do it right. I use DNSStuff.com t...

Two-column lookup help!
Greetings, I am having difficulty looking up an item using two-column lookup formulas as suggested. Following are the parameters of my situation 2 Different Workbooks Workbook 1 (Reference Workbook) Column b c d 125 Lay Foundation March 9, 2004 125 Purchase Frame mat. March 27, 2004 125 House complete May 15, 2004 267 Lay Foundation June 5, 2004 267 Purchase Frame mat. June 28, 2004 267 House complete August 29, 2004 Workbook...

NEED HELP importing database into new install of Exch 2k
I am a small business owner, and we have one main, multi- homed box. This box is a Win2kAS PDC, DNS, IIS 5.0, Exch 2k, & file server. Last week the registry was zapped by a RAM parity error, and the system went into a perpetual reboot mode. I was able to slave the OS drive (we have an OS, and two mirrored data drives) on an XP pro machine to see if I could see any of the data, luckily it's all there. Unfortunately, we didn't have the registry or exchange databases backed up. I've installed a new drive, reinstalled Win2kAS, re-setup AD, IIS 5.0, Exch 2k, and other apps....

Help file book?
Hello, Can anyone recommend a good MS HTML v2.0 help file book, web site, or news group? Thanks, Jacques Jacques, > Can anyone recommend a good MS HTML v2.0 help file > book, web site, or news group? Are you referring to Microsoft's Help 2.0 (.HxS) format? If so, here are some good resources: http://helpware.net/FAR/help/msh2_primer.htm http://helpware.net/mshelp2/h2faq.htm http://www.mshelpwiki.com/index.php?page=Help2 http://www.winwriters.com/mshelp.htm http://groups.yahoo.com/group/MSHelp2 Other than the MSHelp2 group on Yahoo, the best newsgroups for help-related question...

Help Exporting DATE values
I have a table that has 5000 dates in the "date" column. I need the date exported to a comma delimited file in this format... March 10, 2007 But the date is exported like this in the text file... 3/10/2007 0:00:00 How can I fix this? By the way, changing the format of the date field in the design view of the table doesn't seem to fix this. Help! Thanks Hi Sincity Write a query making the date field as follows dateexport: Format([date],"mmmm d"", ""yyyy") then export the query Regards Ian B "SinCity" wrote: > I have a ...

XSLT number-format command and scientific notation (HELP!)
Well, the project I am working on has now come to a screeching halt! I have been developing a program that heavily utilizes ADO.NET record sets. To generate reports, I convert the recordset to XML, and then apply an XSLT to transform the XML into HTML. This works great (or did) until today. I just found out that the "number-format" command in XSLT can't handle scientific notation! So when I try to format these numbers I just get "NaN" on the output report!!! There are only two solutions I can see, and don't know how to implement either of them. One would be to get ...

Outlook 2000 attachments become embedded in text as gibberish! Please help!
?????????????????????????????????????????????????????????????????????????= ?????????????????????????????????????????????????????????????????????????= ???????????????????????????????????????????????>?????????????????????????= ?????????????????????????????????????????????????????????????????????????= ?????????????????????????????????????????????????????????????????????????= ?????????????????????????????????????????????????????????????????????????= ?????????????????????????????????????????????????????????????????????????= ????????????????????????????????????????????????????????????????????????...

Add a line in a chart....help...
I have a spreadsheet where your are supposed too archive curtain goals, based on different activities. I've got six different colums taht shows the activities, I wanna' have a line that shows how the activites mesures up to the goal. Ex. the goal (and the line) is to run 12 times a month, but you only run seven (activities) Anybody who could help, thanks Ns Jon Peltier has instructions for adding a horizontal line to a chart: http://www.peltiertech.com/Excel/Charts/ComboCharts.html#AddLine N Schei wrote: > I have a spreadsheet where your are supposed too archive curt...

macro shortcut help
Hello I have a Macro set up in spreadsheets I have made for multiple people. I have set it up so they can paste the info needed in a worksheet and then use the shortcut ctr(a) to run the macro below to delete all rows with lab in it. Sub Find_LAB() Dim rng As Range Dim what As String what = "LAB" Do Set rng = ActiveSheet.UsedRange.Find(what) If rng Is Nothing Then Exit Do Else Rows(rng.Row).Delete End If Loop End Sub This worked well for a while but now I find that the shortcut is n...

Help finding first payment date and amount
I have a simple table and I need help finding the first payment date and the amount payed. Here is the table CREATE TABLE [dbo].[Payments]( [MemberID] [nchar](10) NOT NULL, [PaymentDate] [datetime] NOT NULL, [Amount] [money] NULL, CONSTRAINT [PK_Payments] PRIMARY KEY CLUSTERED ( [MemberID] ASC, [PaymentDate] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] Here is some data to insert insert into payments values (101,'01-01-2009',20) insert into payment...

Please help! Outlook cannot read mailbox!
Hi, I have a huge problem. I'm using SBS server. I've created a user. They can access their e-mail from outlook web access, but not Outlook itself. In outlook I can't even create a new exchange account, as outlook cannot find the user. Hope that someone can help Btw, I see this in my event log: Information Store (3288) First Storage Group: Index FoldersIndex6 of table Folders is corrupted (0). If OWA works the problem must be with the client or name resolution. 1. Is name resolution from your client to the Exchange server working correctly? 2. If name resolution is not an...

Please Help With Message Delivery Issues.
I work for a not for profit organization. We have a somewhat complicated environment. Here is a brief explanation of our environment. I am sorry this is going to be a long story. I work for an organization that has affiliated organizations throughout the world. Most of the locations use Exchange for messaging. I am based in Atlanta USA (we have Exchange 2K3 & Exchange 5.5). We have an affiliated location in Europe which also have E2K3 & Exchange 5.5. On top of that there are other affiliated locations in Australia, Africa and Latin America. The location in Australia is only runn...