C# Tutorials and offshore development in India
Tutorials Resources Forum Reviews Communities Interview Jobs Projects Training Videos


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...


Birthday Greetings
Learn Windows 7: Simple tips to keep your Laptop Secure   Here are few simple tips to follow to keep your laptop secure



Resources » Code Snippets » Visual Studio »

Xml File Read and Bind


Posted Date: 31 Jul 2009    Resource Type: Code Snippets    Category: Visual Studio
Author: R.Jaya kumar (JK)Member Level: Diamond    
Rating: 1 out of 5Points: 8



Description :


This code shows how to read xml file and bind value.

XML File like this

< NewDataSet >
< Table >
< Country > British Indian Ocean Territory< /Country >
< City > Diego Garcia< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Ahmadabad< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Akola< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Aurangabad Chikalthan Aerodrome< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Bombay / Santacruz< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Bilaspur< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Bhuj-Rudramata< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Belgaum / Sambra< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Bhopal / Bairagarh< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Bhaunagar< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Goa / Dabolim Airport< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Indore< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Jabalpur< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Khandwa< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Kolhapur< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Nagpur Sonegaon< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Rajkot< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Sholapur< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Agartala< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Siliguri< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Bhubaneswar< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Calcutta / Dum Dum< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Car Nicobar< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Gorakhpur< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Gauhati< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Gaya< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Imphal Tulihal< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Jharsuguda< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Jamshedpur< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > North Lakhimpur< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Dibrugarh / Mohanbari< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Port Blair< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Patna< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > M. O. Ranchi< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Agra< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Allahabad / Bamhrauli< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Amritsar< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Varanasi / Babatpur< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Bareilly< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Kanpur / Chakeri< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > New Delhi / Safdarjung< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > New Delhi / Palam< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Gwalior< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Hissar< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Jhansi< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Jodhpur< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Jaipur / Sanganer< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Kota Aerodrome< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Lucknow / Amausi< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Satna< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Udaipur Dabok< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Bellary< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Vijayawada / Gannavaram< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Coimbatore / Peelamedu< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Cochin / Willingdon< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Cuddapah< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Hyderabad Airport< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Madurai< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Mangalore / Bajpe< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Madras / Minambakkam< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Tiruchchirapalli< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Thiruvananthapuram< /City >
< /Table >
< Table >
< Country > India< /Country >
< City > Vellore< /City >
< /Table >
< /NewDataSet >


client Side Code


< html xmlns="http://www.w3.org/1999/xhtml" >
< head runat="server" >
< title >Untitled Page< /title >
< /head >
< body >
< form id="form1" runat="server" >
< div >
< asp:DataGrid ID="dtg1" runat ="Server" AutoGenerateColumns ="false" >
< Columns >
< asp:TemplateColumn HeaderText ="Country" >
< ItemTemplate >
< asp:Label ID="lbl1" runat ="server" Text ='< %# Bind("Country") % >' >< /asp:Label >
< /ItemTemplate >
< /asp:TemplateColumn >


< asp:TemplateColumn HeaderText ="City" >
< ItemTemplate >
< asp:Label ID="lbl2" runat ="server" Text ='< %# Bind("City") % >' >< /asp:Label >
< /ItemTemplate >
< /asp:TemplateColumn >
< /Columns >
< /asp:DataGrid >

< /div >
< /form >
< /body >
< /html >


Server Side

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
cls1 = New ClsConnect
ds.ReadXml(Server.MapPath("XMLFile.xml"))
dtg1.DataSource = ds
dtg1.DataBind()
End Sub





Responses to the resource: "Xml File Read and Bind"

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

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
Xml File Read and Bind  .  

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: How to use a comboBox in Silverlight
Previous Resource: Fax Coding
Return to Resources
Post New Resource
Category: Visual Studio


Post resources and earn money!
 
More Resources



About Us    Contact Us    Privacy Policy    Terms Of Use