473,811 Members | 2,770 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help Linq to XML How to MoveFirst, Move Next, Move Previous, MoveLast

I have the Next XML

var xml = new XElement( "clients",
new XElement("clien t",
new XAttribute("id" ,1),
new XElement( "name", "Luis"),
new XElement( "country",
"Portugal")
),
new XElement("clien t",
new XAttribute("id" ,2),
new XElement( "name", "John"),
new XElement( "country",
"England")
),
new XElement("clien t",
new XAttribute("id" ,3),
new XElement( "name", "Edwin"),
new XElement( "country", "Costa
Rica")
),
new XElement("clien t",
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("cl ient");
Debug.WriteLine (firstClient);
var ancestor = firstClient.Nex tNode;
Debug.WriteLine (ancestor);

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

Edcha
Nov 3 '08 #1
2 3165
edcha wrote:
And I nedd one code to move between nodes but Without use Foreach or
While, Only I Can do next.

var firstClient = xml.Element("cl ient");
Debug.WriteLine (firstClient);
var ancestor = firstClient.Nex tNode;
Debug.WriteLine (ancestor);

But with this don`t move more than "id",2 Please Help
Is that some sort of homework assignment or why can't you use foreach or
while?
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Nov 3 '08 #2
this is not a homework

only I need a 4 control btnMoveFrst etc. to move in every node

Thamks.

Nov 3 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
5174
by: tym | last post by:
HELP!!! I'm going round the twist with this... I have a VB6 application which is using DAO to access a database (Please - no lectures on ADO, I know what I'm doing with DAO!!) Ok, problem is this.... importing a large csv file (189000 lines, 7 fileds per line)
0
2853
by: AR Hall | last post by:
This code goes through 3 work sheets in the same XL workbook, day, eve and night shift in each sheet their are columns representing production work orders and reject and downtime for each order so in the tblproductiondetail there is one record for each work order and many reject or downtime records (one to many) code works fine to get a new record for each work order main info but when creating the sub table related records for...
8
2235
by: Henrik Larsson | last post by:
Hi, I need help with selecting the following rows from a table looking like this: ID IP Query 1 -> 1 2.2.2.2 (ie first IP 1 1.1.1.1 <- Query 2 for each ID) 1 3.3.3.3 (ie second IP for each ID) -> 2 5.5.5.5 2 6.6.6.6 <-
1
3149
by: Marcin Zmyslowski | last post by:
Hello! I use data.read and data.getValue(Id_column) to get the value of specified column. Unfortunately there are some differences between VBScript and Visual Basic (MS Access) and I cannot move to the first and last record of data. I searched archieves and I couldn`t find any example how to do it. I use MS SQL Server 2000 as a server and I wrote a sql query where I used data.reader. Could you give me the example how to modify the code...
2
2356
by: jodyblau | last post by:
I'm not certain that what I am trying to do is possible; in any event I haven't been able to figure it out. Here is what I am trying to do: I have one table that has a list of cases I'm working on. I have a second table that contains a list of tasks to be performed and relates to the Case_List through a Case_ID. So currently, I can bring up a form that has a list of all my cases, I can then select a case and it opens a new form that...
3
1442
by: congngo | last post by:
Hi all My code is working fine. I just need help with looping the rst.move Dim rst As Recordset Dim varCXL1, varCXL2, varclx3, varCXL4, varCXL5 As Integer Set rst = CurrentDb.OpenRecordset("qry_cxlcount") rst.MoveFirst
4
1838
by: chaekung | last post by:
I have problem when open the record set as below code : Private Sub Text4_LostFocus() Dim dbs As Database Dim rs As Recordset Dim sql As String On Error Resume Next Set dbs = CurrentDb() sql = "select * from tbl_InsertPicture where pname = '" & Text4 & "'" Set rs = dbs.OpenRecordset(sql)
1
6377
by: klaydze | last post by:
i have here my lines of codes. how can i use the RECORDSET.MOVELAST in VB.NET. because i need to use the rs.movelast so that my pointer will go to the last record in my database. this line of code will increment the id depending on what is the value of the txtctr.if the value of txtctr=3 then my id will be 0001,0002,0003. Dim objDataAdapter As New SqlDataAdapter Dim objCommand As New SqlCommand Dim objDataSet As...
0
1793
by: edcha | last post by:
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",
0
9605
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10651
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10393
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10405
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9208
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7671
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5697
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4342
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3020
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.