StrataFrame Forum

Business Object and XML with GUID types

http://forum.strataframe.net/Topic7361.aspx

By Robin J Giltner - 3/8/2007

I have a BusinessObject that I need to export records and import records.  I looked through your code in your XML data source example and it seems to work great for the exporting.  The XML file looks perfect.  My problem is with the importing, I pretty much copied the code from the example and I get an error of "Failed to convert parameter value from a String to a Guid".

Dim loDS As New DataSet

loDS.ReadXml(loOpenFileDialog.FileName)

Dim loBusinessObject As New MyTypedBusinessObject

Try

loBusinessObject.CopyDataFrom(loDS.Tables(0), MicroFour.StrataFrame.Business.BusinessCloneDataType.ClearAndFillFromCompleteTable)

If loBusinessObject.MoveFirst = True Then

Do

loBusinessObject.CurrentRow.SetAdded()

Loop While loBusinessObject.MoveNext()

End If

loBusinessObject.Save()

When I stop before the save, the fields that have GUID types in them, have an error of "Specified cast is not valid".

Do I need to write a method to copy the data from this XML file into the Businessobject converting values to the types they need to be as they get copied in, or am I missing something in the copying?

Thanks,

Robin Giltner

By Robin J Giltner - 3/8/2007

Well, it appears that changing my CloneDataType from "

ClearAndFillFromCompleteTable" to "

AppendDataToTableFromCompleteTable" seems to have fixed my problem.

Are you guys just using mental projection now to cut down on forum traffic or what? ;-)

Robin Giltner

By Trent L. Taylor - 3/8/2007

Are you guys just using mental projection now to cut down on forum traffic or what? ;-)

Yeah...it is a new tactic we have started implementing BigGrin 

Glad you found it Wink