<?xml version="1.0" encoding="utf-8" ?>
<phonebook>
<phone-number category = "family_relatives">
<name> cathy </name>
<number type = "vodafone"> 9804423599</number>
</phone-number>
<phone-number category = "office">
<name>MAPLE </name>
<number>051235 </number>
<address> MCIOEJAERJ</address>
</phone-number>
<phone-number category="peers">
<name>15vregtre </name>
<number>23154632165 </number>
<address>klgirmfgj </address>
<designation>klirglkfg </designation>
</phone-number>
</phonebook>
************************
How to view this xml file via data grid view in C# form application?
I did it in the way:
****************************
DataSet ds=new DataSet();
ds.ReadXml("PhoneBookDirectory.xml");
datagridview1.DataSource=ds.Tables(0);
************************
ERROR:
the name datagridview1 does not exist in the current context
Non-invocable member 'System.Data.DataSet.Tables' cannot be used like a method.
************************
ds.ReadXml("Yourfilepath");
ds.ReadXml("E:\projects\xml\practice\PhoneBook\PhoneBook\PhoneBookDirectory.xml");
when I copied the full path from the xml file, it shows the error:
Unrecognized escape sequence
**********************************
What is the problem?

New Topic/Question
Reply




MultiQuote




|