473,503 Members | 3,884 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"Reading data from Xml in smart phones "

16 New Member
hi guys,

My Xml File

<xml version="1.0">
<Name>
<Firstname> Infowave </Firstname>
<Lastname> Homes </Lastname>
</Name>
</xml>

Here am use Parent element '<name> and child elements <Firstname><Lastname> .......................

Im my smart pfone when i cick button i need these two
names in two text boxes....................
I already try "Server.Transfer" but this property is not support
Windows application. any one can give idea..................

Ganesh
Nov 27 '07 #1
2 1847
markmcgookin
648 Recognized Expert Contributor
Hi there,

you will need an xml reader to read in the xml values you want. Then use a nodelist to get the specific values you want and then save them.

i.e.
Expand|Select|Wrap|Line Numbers
  1.                     XmlDocument xmlDoc = new XmlDocument();
  2.                     xmlDetails.Load(xmlFilePath);
  3.                     XmlNodeList nodeList =               xmlDetails.GetElementsByTagName("Name");
  4.  
  5.                     string FirstName= "";
  6.                     string LastName= "";
  7.  
  8.                     foreach (XmlElement elem in nodeList)
  9.                     {
  10.                         foreach (XmlElement tempElem in elem.ChildNodes)
  11.                         {
  12.                             if (tempElem.Name == "FirstName")
  13.                             {
  14.                                 FirstName= tempElem.InnerText;
  15.                             }
  16.  
  17.                             if (tempElem.Name == "LastName")
  18.                             {
  19.                                 LastName= tempElem.InnerText;
  20.                             }
  21.                         }
  22.  
  23.                         break;
  24.                     }
  25.  
  26. this.textBox1.text = FirstName;
  27. this.textBox2.text = LastName;
  28.  
Nov 27 '07 #2
RedSon
5,000 Recognized Expert Expert
I deleted your other double post. Please do not do that again or there will be consequences.

-MODERATOR

Same for you Mark, but I deleted it (so your safe) :-P
Dec 6 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

9
12209
by: Martin Goldman | last post by:
Hello all, I've been struggling for a few days with the question of how to convert "smart" (curly) quotes into straight quotes. I tried playing with the htmlentities() function, but all that is...
2
4256
by: Tim Hochberg | last post by:
During the recent, massive, painful Lisp-Python crossposting thread the evils of Python's whitespace based indentation were once again brought to light. Since Python' syntax is so incredibly...
14
2652
by: David B. Held | last post by:
I wanted to post this proposal on c.l.c++.m, but my news server apparently does not support that group any more. I propose a new class of exception safety known as the "smart guarantee". ...
4
8191
by: grogerteal | last post by:
Hello, I am pretty new to programming and would like someone to help me get started on the program that I need to make. I hope it is not hard to do, but what I would like is a simple app that...
11
7000
by: Ron | last post by:
Hello, I'm having an aggravating time getting the "html" spewed by Word 2003 to display correctly in a webpage. The situation here is that the people creating the documents only know Word, and...
3
3201
by: red floyd | last post by:
I've got some code where somebody cut&pasted some comments from MS Word, and so these comments have "smart quotes" (in particular apostrophes) embedded. The apostrophe is character hex 0x92. ...
5
2877
by: Noozer | last post by:
I'm looking for a "smart folder" program to run on my Windows XP machine. I'm not having any luck finding it and think the logic behind the program is pretty simple, but I'm not sure how I'd...
0
1482
by: =?Utf-8?B?YmFtbm9sYQ==?= | last post by:
When using Windows Live Hotmail and the "bottom" reading pane option chosen, the messages list shows up but no message, not even when I (single) click on the message. The only way to open and...
0
7188
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,...
0
7258
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,...
0
7441
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5558
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,...
1
4987
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...
0
3156
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1489
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 ...
1
720
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
366
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...

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.