.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> C# >> Post New QuestionBookmark and Share Subscribe to Forum

Binding XML Data to Grid view using c#

Posted By: Sathya     Posted Date: January 27, 2011    Points:2   Category :C#
I've visual studio 2010.
I created an application to display Xml data in Data Gridview.But i can not bind the data source with the Grid view.I use C#.

In Visual studio 2010(.Net framework 4.0),How to bind Xml data to the Grid view?


Responses
Author: Amit Mehra             
Posted Date: January 27, 2011     Points: 5   

Hi,

1st load the data into dataset using below code

DataSet ds = new DataSet();
ds.ReadXml(YourXMLFilePath);


Than bind the dataset to GridView using below code

GridView1.DataSource = ds;
GridView1.DataBind();


Thanks,
Amit
Please "Mark As Answer " if this post help you.
Author: Syed Shakeer Hussain             
Posted Date: January 30, 2011     Points: 5   

Hi,
Check this Link for binding XML data to Griview

http://dotnetf1.blogspot.com/2008/01/binding-to-xml-data-to-gridview-in.html



Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend