tags:

views:

712

answers:

1
<?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;
    }
+3  A: 

Try using a Dataset rather

DataSet dt = new DataSet();
dt.ReadXml(@"d:\test.xml");
MessageBox.Show(dt.Tables[0].Rows[0]["ID"].ToString());

Found at

DataTable.ReadXml(filename) throws an error. Why?

astander