Charles,It's good to hear from you. There are several ways to do this. I cannot remember what language you are using, but you can create a business object and pull its structure from an existing database or from the BO mapper solely for the purpose of strong-typing the BO through the BO Mapper. However, to pull the data from an XML file and then interact with that data through the BO and then save it back to the XML file, you will need to add code similar to this:
''' <summary>
''' Create a method for loading the XML file
''' </summary>
''' <remarks></remarks>
Public Sub FillFromXMLFile()
'-- Establish Locals
Dim loTable As New DataTable()
'-- Load the XML file into a data table
loTable.ReadXml("c:\temp\myxmlfile.xml")
'-- Move the data from the XML file into the business object
Me.CopyDataFrom(loTable, MicroFour.StrataFrame.Business.BusinessCloneDataType.ClearAndFillFromCompleteTable)
'-- Smoke the temp data table
loTable.Dispose()
End Sub
''' <summary>
''' Overwrite the save so it will update the XML file
''' </summary>
''' <returns></returns>
''' <remarks></remarks>
Public Shadows Function Save() As MicroFour.StrataFrame.Data.SaveUndoResult
'-- Establish Locals
Dim loReturn As MicroFour.StrataFrame.Data.SaveUndoResult = MicroFour.StrataFrame.Data.SaveUndoResult.Success
Try
'-- If changes exist, the update the XML file
If Me.IsDirty Then
'-- Remove any existing file
If System.IO.File.Exists("c:\temp\myxmlfile.xml") Then
System.IO.File.Delete("c:\temp\myxmlfile.xml")
End If
'-- Write the changes back
CurrentDataTable.WriteXml("c:\temp\myxmlfile.xml", True)
'-- Update the internal data table so the BO is no longer dirty
Me.CurrentDataTable.AcceptChanges()
End If
Catch ex As Exception
loReturn = MicroFour.StrataFrame.Data.SaveUndoResult.Cancelled
End Try
'-- Return the results
Return loReturn
End Function
Let me know if this gets you going in the right direction. If not, I will create you a sample and send it your way. Thanks and it was really good to see your name on the posts.