<?xml version="1.0" encoding="utf-8"?> <PHP_Adapter> <Adapter> <ID>11</ID> <Provider>22</Provider> <Connectstring>33</Connectstring> </Adapter> </PHP_Adapter>
This my Xml file what wrong?
bool CheckAdapterExist(string aid) { DataTable dt = new DataTable(); dt.ReadXml(axml); MessageBox.Show(dt.Rows[0]["ID"].ToString()); return true; }
Try using a Dataset rather
DataSet ds = new DataSet(); ds.ReadXml(@"d:\test.xml"); MessageBox.Show(ds.Tables[0].Rows[0]["ID"].ToString());
Found at
DataTable.ReadXml(filename) throws an error. Why?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With