473,563 Members | 2,884 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Almost there - Just need some type of "equals" statement

Rob
The code below is almost there (it does change the value for EVERY
ORDER)....
I simply want to be able to change the value of the Delivered Tag to Yes.
BUT ONLY if the Order is equal to 123456 ?

<?xml version="1.0" encoding="UTF-8" ?>
- <AllOrders>
- <Order OrderId="123456 ">
<Route>1</Route>
<SalesOrder>123 456</SalesOrder>
<Customer>ABC </Customer>
<CustomerName>A lpha Company</CustomerName>
<ReqDeliveryDat e>5/27/2006</ReqDeliveryDate >
<Delivered>No </Delivered>
<Signed>No</Signed>
</Order>
<Order OrderId="555456 ">
<Route>1</Route>
<SalesOrder>555 456</SalesOrder>
<Customer>ABC </Customer>
<CustomerName>A lpha Company</CustomerName>
<ReqDeliveryDat e>5/27/2006</ReqDeliveryDate >
<Delivered>No </Delivered>
<Signed>No</Signed>
</Order>.....

For Each Order In doc.GetElements ByTagName("Orde r")
Dim Delivered As XmlElement = Order.GetElemen tsByTagName("De livered")(0)
'What can I put here that says... Only perform the following if the Order
value is equal to 123456
If Not (Delivered Is Nothing) Then
Delivered.Inner Text = "No"
End If
' End if Assumed here
Next
May 23 '06 #1
1 1343
Not just 100% sure what your trying to do - but perhaps this will help:

For Each Order In xdoc.GetElement sByTagName("Ord er")
If Not (Order.SelectSi ngleNode("Deliv ered") Is Nothing)
Then
If Order.SelectSin gleNode("Delive red").InnerTex t =
"123456" Then
' Do something
Else
' Do something else
End If
End If
Next

Dickster

May 23 '06 #2

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

Similar topics

15
2519
by: D E | last post by:
Ok the subject line is basically the question. Obviously this won't work. What is the technical reason? Is it because here, "test1" is sort of like a static object now? What exactly is "test1" in this case? Thanks.
3
17634
by: Fei Li | last post by:
Hi, take string class as an example, who can explain the difference? Thanks
4
1544
by: Rich | last post by:
Hello, Just checking which is more efficient/better/or correct Do While something str1 = dr(i).ToString If Not str1.Equals("xyz") Then .... or
2
2167
by: Phil Davidson | last post by:
/* (Posted to microsoft.public.dotnet.languages.vc) In C++/CLI under Visual Studio 2005, creating an "enum class" member called "Equals" can cause compiler error C1060 (out of memory) and C1063 (internal error). See the following example program, a CLR console app. Of course the obvious workaround is to refrain from using "Equals". But...
0
7664
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7885
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. ...
0
8106
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...
1
7638
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...
1
5484
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...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2082
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
1
1198
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
923
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...

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.