---
title: "Search in XML and show results in GridView"  
description: "Search in XML and show results in GridView"  
author: "Anonymous User"  
published: 2014-11-17  
updated: 2014-11-17  
canonical: https://www.mindstick.com/forum/12627/search-in-xml-and-show-results-in-gridview  
category: "c#"  
tags: ["c#", "xml", "gridview"]  
reading_time: 1 minute  

---

# Search in XML and show results in GridView

I have an [XML data](https://www.mindstick.com/forum/149/problem-in-showing-the-xml-data-in-table-form-on-browser) of [Employees](https://www.mindstick.com/articles/44463/business-to-business-vat-reclaiming-a-guide-for-your-employees), I want to parse this data and show it in [Gridview](https://www.mindstick.com/articles/873/update-delete-edit-gridview-in-asp-dot-net) using C# in ASP.NET.

Based on [search](https://www.mindstick.com/articles/65368/best-smo-services-company-in-hyderabad-improve-search-rankings) [parameters](https://www.mindstick.com/articles/87/passing-parameters-in-c-sharp) like [Employee](https://www.mindstick.com/articles/85431/remote-employee-training-tips-tricks) ID or Company ID or Department ID, I should be able to [filter](https://www.mindstick.com/forum/1176/filter-in-a-xml-file-in-c-sharp) the data and [update](https://www.mindstick.com/forum/156353/what-is-hummingbird-update) the GridView.

Checked few [links](https://www.mindstick.com/blog/415/css3-links) in [internet](https://www.mindstick.com/articles/44650/what-should-you-do-during-an-internet-outage), but nothing matches this particular format.. Is it possible to achieve.. (Any links to) code will be helpful.

```
  <?xml version="1.0" encoding="utf-8"?>      <Employees>        <Employee>          <Id> TG18-2002</Id>          <Name> AAPM^Test^Patterns</Name>          <Sex> O </Sex>          <Company>            <Id> 2.16</Id>                        <Department>              <Id> 2.16.124</Id>              <Project>                <Id> 2.16.124.113543</Id>              </Project>            </Department>          </Company>        </Employee>        <Employee>          <ID> TG18-2003</ID>          <Name> AAPM^Test^Patt</Name>          <Sex> O </Sex>          <Company>            <ID> 2.16</ID>                        <Department>              <ID> 2.16.124</ID>              <Project>                <ID> 2.16.124.113543</ID>              </Project>            </Department>          </Company>        </Employee>        <Employee>      </Employees>
```

## Replies

### Reply by Sumit Kesarwani

HI Pravesh, \
try this:\

DataSet xmlData = new DataSet();

xmlData.ReadXml(YourXMLPath);

GridviewControl1.DataSource = xmlData.Tables[0];


---

Original Source: https://www.mindstick.com/forum/12627/search-in-xml-and-show-results-in-gridview

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
