﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Business Objects and Data Access (How do I?)  » XML to BO</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 17:01:10 GMT</lastBuildDate><ttl>20</ttl><item><title>XML to BO</title><link>http://forum.strataframe.net/FindPost2402.aspx</link><description>I need to import data from a number of XML documents, I looked through the SF namespaces for a function to do this but didn't find anything. I want to makes sure I am not missing it before I do it by hand like I used to do with a reader. Essentially I am looking for VFP's 'cursortoxml'. Do you have something like that I have missed?</description><pubDate>Fri, 25 Aug 2006 11:23:46 GMT</pubDate><dc:creator>Keith Chisarik</dc:creator></item><item><title>RE: XML to BO</title><link>http://forum.strataframe.net/FindPost2477.aspx</link><description>If all of those rows need to be set to dirty, the you can manually set each of those rows into a dirty state.&lt;/P&gt;&lt;P&gt;Me.CurrentDataTable.Rows(0).SetModified()&lt;/P&gt;&lt;P&gt;This will tell the BO that this record needs to be updated.&amp;nbsp; If it is a new record then use this method:&lt;/P&gt;&lt;P&gt;Me.CurrentDataTable.Rows(0).SetAdded()</description><pubDate>Fri, 25 Aug 2006 11:23:46 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: XML to BO</title><link>http://forum.strataframe.net/FindPost2476.aspx</link><description>How do I save the BO with my newly added records then? &lt;br&gt;
&lt;br&gt;
I tried putting it in edit mode, the save() then causes a collision.</description><pubDate>Fri, 25 Aug 2006 11:20:50 GMT</pubDate><dc:creator>Keith Chisarik</dc:creator></item><item><title>RE: XML to BO</title><link>http://forum.strataframe.net/FindPost2475.aspx</link><description>[quote]I see them added, but they dont get saved.. is there something special about using CopyDataFrom?[/quote]&lt;/P&gt;&lt;P&gt;When you copy the data in the CurrentDataTable rejects any previous changes.&amp;nbsp; If you look at the .IsDirty property before and after the copy, you will see that it will be False after the copy.</description><pubDate>Fri, 25 Aug 2006 11:13:08 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: XML to BO</title><link>http://forum.strataframe.net/FindPost2474.aspx</link><description>great, sorry I missed that 2nd parameter.&lt;br&gt;
&lt;br&gt;
Now why isnt the save committing the records back to the SQL server?&lt;br&gt;
&lt;br&gt;
        OrdersBO.CopyDataFrom(importedorder_datatable, MicroFour.StrataFrame.Business.BusinessCloneDataType.AppendDataToTableFromCompleteTable)&lt;br&gt;
        OrdersBO.Save()&lt;br&gt;
&lt;br&gt;
I see them added, but they dont get saved.. is there something special about using CopyDataFrom?&lt;br&gt;
&lt;br&gt;
If I manually do it, it does save.&lt;br&gt;
&lt;br&gt;
Me.OrdersBO.newRow()&lt;br&gt;
Me.OrdersBO.order_dt = DateTime.Parse(currow("order_ndt"))&lt;br&gt;
Me.OrdersBO.Save()</description><pubDate>Fri, 25 Aug 2006 11:10:49 GMT</pubDate><dc:creator>Keith Chisarik</dc:creator></item><item><title>RE: XML to BO</title><link>http://forum.strataframe.net/FindPost2473.aspx</link><description>[quote]Bug? or does vb.net just not like underscores in tablenames?&lt;BR&gt;[/quote]&lt;/P&gt;&lt;P&gt;This would be related to .NET since we do not have control over the compiler.&amp;nbsp; But there is something not quite right because I know that I have done this in the past.&lt;/P&gt;&lt;P&gt;[quote]Also CopyDataFrom clears the contents of the current BO, is there something like AppendDataFrom? If not I can do it manually easy enough.[/quote]&lt;/P&gt;&lt;P&gt;Look at the second parameter.&amp;nbsp; There is an option to append or clear.</description><pubDate>Fri, 25 Aug 2006 10:58:41 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: XML to BO</title><link>http://forum.strataframe.net/FindPost2472.aspx</link><description>Me.OrdersBO.CopyDataFrom(importedorder_datatable)&lt;br&gt;
&lt;br&gt;
I get an error because CopyDataFrom thinks the table name is 2 parameters due to the underscore, it works fine if I remove it.&lt;br&gt;
&lt;br&gt;
Bug? or does vb.net just not like underscores in tablenames?&lt;br&gt;
&lt;br&gt;
I haven't had problems with underscores anywhere else, I generally have always used an underscore in any dynamic table name just as a personal convention, it helps me to identify them as dynamic.&lt;br&gt;
&lt;br&gt;
Also CopyDataFrom clears the contents of the current BO, is there something like AppendDataFrom? If not I can do it manually easy enough.&lt;br&gt;
&lt;br&gt;
Thanks</description><pubDate>Fri, 25 Aug 2006 10:24:59 GMT</pubDate><dc:creator>Keith Chisarik</dc:creator></item><item><title>RE: XML to BO</title><link>http://forum.strataframe.net/FindPost2470.aspx</link><description>Microsoft XSD Inference 1.0&lt;br&gt;
The Microsoft XSD Inference utility is used to create an XML Schema definition language (XSD) schema from an XML instance &amp;#100;ocument. When provided with wellformed XML file, the utility generates an XSD that can be used to validate that XML file. You can also refine the XSD generated by providing the tool more wellformed XML files. The download contains the core library, simple command line utility and the source code.&lt;br&gt;
&lt;br&gt;
Package is attached&lt;br&gt;
&lt;br&gt;
:)</description><pubDate>Thu, 24 Aug 2006 22:43:52 GMT</pubDate><dc:creator>Daniel Essin</dc:creator></item><item><title>RE: XML to BO</title><link>http://forum.strataframe.net/FindPost2418.aspx</link><description>You can get it to work...I have done this on a number of occasions.&amp;nbsp; First, look at the ReadXmlSchema method on the DataTable.&amp;nbsp; Second, reverse engineer the WriteXml on the DataTable which has support for the schema.</description><pubDate>Wed, 23 Aug 2006 15:38:10 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: XML to BO</title><link>http://forum.strataframe.net/FindPost2417.aspx</link><description>You can only read the XML file if it was written to the file using the business object's table.&amp;nbsp; When the table writes it's data to disk, there is an overload that allows you to tell it that you want to write the schema to file as well.&amp;nbsp; If you write the schema, then you can read the file and schema back in.</description><pubDate>Wed, 23 Aug 2006 15:36:04 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: XML to BO</title><link>http://forum.strataframe.net/FindPost2414.aspx</link><description>"DataTable does not support schema inference from XML." is what I get when I try your code.&lt;br&gt;
&lt;br&gt;
I tried a few difference XML documents.</description><pubDate>Wed, 23 Aug 2006 15:18:36 GMT</pubDate><dc:creator>Keith Chisarik</dc:creator></item><item><title>RE: XML to BO</title><link>http://forum.strataframe.net/FindPost2407.aspx</link><description>nice...... ty</description><pubDate>Wed, 23 Aug 2006 13:16:08 GMT</pubDate><dc:creator>Keith Chisarik</dc:creator></item><item><title>RE: XML to BO</title><link>http://forum.strataframe.net/FindPost2405.aspx</link><description>You can do this straight into a business object also by using the CopyDataFrom method.&amp;nbsp; Use the code I posted previously, then you can load that data table into the business object through the CopyDataFrom method.</description><pubDate>Wed, 23 Aug 2006 13:12:43 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: XML to BO</title><link>http://forum.strataframe.net/FindPost2404.aspx</link><description>Give this a shot:&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;Dim&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; loTable &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; Data.DataTable()&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;loTable.ReadXml(&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;"C:\MyXmlFile.xml"&lt;/FONT&gt;&lt;FONT size=2&gt;)&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Wed, 23 Aug 2006 13:11:49 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>