Business Object and XML with GUID types


Author
Message
Robin J Giltner
Robin J Giltner
StrataFrame User (137 reputation)StrataFrame User (137 reputation)StrataFrame User (137 reputation)StrataFrame User (137 reputation)StrataFrame User (137 reputation)StrataFrame User (137 reputation)StrataFrame User (137 reputation)StrataFrame User (137 reputation)StrataFrame User (137 reputation)
Group: Forum Members
Posts: 105, Visits: 650
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

Robin J Giltner
Robin J Giltner
StrataFrame User (137 reputation)StrataFrame User (137 reputation)StrataFrame User (137 reputation)StrataFrame User (137 reputation)StrataFrame User (137 reputation)StrataFrame User (137 reputation)StrataFrame User (137 reputation)StrataFrame User (137 reputation)StrataFrame User (137 reputation)
Group: Forum Members
Posts: 105, Visits: 650
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


Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
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

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search