I get the error “Table doesn’t have a primary key.” so how do I set the primary keys, does it not do this when I call ReadXml() or have a missed a arg out??
MemoryStream msXml = new MemoryStream(byteArray);
DataSet dsXml = new DataSet();
dsXml.ReadXml(msXml);
string s = "123456789";
DataRow foundRow = dsXml.Tables["Accounts"].Rows.Find(s);
EDITED
Here is a basic example of the format of my xml file. How would I set primary keys for each CD?
Thanks
Thanks all for you help I managed to fingure it out. Example below worked for me if it helps anyone else.
DataSet dsXml = new DataSet();
dsXml.ReadXml(msXml);
DataTable tbl;
tbl = dsXml.Tables["Accounts"];
tbl.PrimaryKey = new DataColumn[] { tbl.Columns["Id"] };