I am having trouble displaying the XML on my c# WinForm.
My XML file looks like this:
<HotelDatabase>
<Hotel Name="ABC" Location="XYZ">
<Room Type="Single" Count="5" Price="2000" />
<Room Type="Superior" Count="3" Price="4000" />
</Hotel>
<Hotel Name="DEF" Location="LMN">
<Room Type="Single" Count="5" Price="2000" />
<Room Type="Superior" Count="3" Price="4000" />
</Hotel>
</HotelDatabase>
My Code for displaying the data in DataGridView looks like this:
var dataSet = new DataSet();
dataSet.ReadXml(Properties.Settings.Default.HotelDB);
dataGridViewHotelList.DataSource = dataSet.Tables[0];
When I run this code, only Name and Location is displayed. I want all the attributes in the Hotel element and its child element to be displayed in a datagridview.