[2008] DataSet.ReadXML question
Hi,
As a relative newcomer to XML, I wonder if somebody could confirm my suspicions.
If I have a DataSet created in the designer, containing one table, am I right in thinking that to add records to the table, I would need to iterate through my DataSet.ReadXML, and populate the designer dataset one record at a time?
Re: [2008] DataSet.ReadXML question
nope,You can directly add new Record to you datatble object by using DataRow Object.
e.g
Code:
dim drNew as DataRow
drNew = dtMyTable.NewRow
drNew.Item(0) = "Value"
dtMyTable.Rows.Add(drNew)
the above code will add new record to your datatable.
Ps: I Hope i got you question right.
Re: [2008] DataSet.ReadXML question
The DataSet.ReadXml method will read the whole contents of the xml file into the dataset.
Re: [2008] DataSet.ReadXML question
Thanks for your replies.
The designed DataSet is in place due to the requirements of the ReportViewer. I simply wanted to read my XML file, and stuff it into the designed DataSet.DataTable.
I had wanted to do a simple ReadXML, but because this reads everything all in one go, I was thinking that I'd have to set up an XML reader to read one record in at a time.