|
-
Jul 23rd, 2008, 05:25 AM
#1
Thread Starter
Addicted Member
[2008] How do I populate a Strongly Typed DataSet with XML
I am trying to populate a table in a strongly typed dataset used for the ReportViewer.
I want to read in an XML file which was created manually using ds.WriteXML.
The strongly typed dataset has been created to match the structure of the XML file written with ds.WriteXML.
How do I read in the XML file, and populate the table within the dataset used for the ReportViewer?
-
Jul 23rd, 2008, 07:11 AM
#2
Re: [2008] How do I populate a Strongly Typed DataSet with XML
If the WriteXml method was used to write the XML, what method do you suppose would be used to read the XML?
-
Jul 23rd, 2008, 09:02 AM
#3
Thread Starter
Addicted Member
Re: [2008] How do I populate a Strongly Typed DataSet with XML
No, you misunderstood.
I AM using ReadXML, but I only seem able to read the XML into a NEW dataset ... I'm just struggling to pass what I've read to the strongly typed dataset.
I can't, for example, use StronglyTypedDataSet.ReadXML(filename).
As a workaround, I've forced the code to dump the designed report bindings in favour of my programmed bindings.
-
Jul 23rd, 2008, 05:24 PM
#4
Re: [2008] How do I populate a Strongly Typed DataSet with XML
Really? What happens when you try? I'd have thought that as long as the schemas matched it would be fine. That said, I haven't tested that. Maybe ReadXml tries to discard the existing schema and create a new, although I'd have thought you could control that. Have you read the documentation for the method to see? If you can't then I guess you would have to use two steps. Read the data in first and then populate the DataSet manually. For the first step you could use an XmlReader, an untyped DataSet or an XmlDataDocument.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|