C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




Reading Values From ChildNodes in XMl


Posted Date: 16 Aug 2006    Resource Type: Articles    Category: .NET Framework
Author: siva kumarMember Level: Gold    
Rating: Points: 3



suppose XML document have these nodes like this..



23
sd
34546
< /emp>

------------------------------------------------------------------------------------
If u want to Read ,, valus u can read from following code
private void BIndXML()
{
XmlDocument doc=new XmlDocument();
doc.Load(Server.MapPath("doc.Xml"));
XmlNodeList node=doc.SelectNodes("EMPS/EMP");
DataTable dt=new DataTable();
DataRow dr;
dt.Columns.Add("NAME");
dt.Columns.Add("SALARY");
dt.Columns.Add("DEsign");
foreach(XmlNode li in node)
{
dr=dt.NewRow();
dr[0]=li.ChildNodes[0].InnerText;
dr[1]=li.ChildNodes[1].InnerText;
dr[2]=li.ChildNodes[2].InnerText;
dt.Rows.Add(dr);
}
DataSet ds=new DataSet();
ds.Tables.Add(dt);
DataGrid1.DataSource=ds;
DataGrid1.DataBind();
}




Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Creating Multiple Sub Root Node
Previous Resource: Treeview in Asp.net
Return to Discussion Resource Index
Post New Resource
Category: .NET Framework


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use