المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : XML to DataTable



C# Programming
06-25-2009, 10:30 AM
Dear All,
I have following xml which i want to convert it into DataTable, but it doesent reports any record
the xml file contents



28-2801-0001
Form6
1
c:\PDF Files\BAMYAN\Bamyan\28-2801-0001\Form6\28-2801-0001-F6.pdf
2
The Form is Scanned in low Quality
6
28



and the code to read the xml file is
XmlTextReader read=new XmlTextReader("xmltopic.xml");
while (read.Read()) {

}
DataTable dt=new DataTable();
dt.ReadXml(read);
MessageBox.Show(dt.Rows.Count.ToString()); //returns 0 rows

how can i convert that xml into dataTable?

Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan