StrataFrame Forum

How do I use the XML DataType

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

By Crones - 1/28/2008

I am wanting to utilize the SQL 2005 XML DataType as a field for a history table and I'm having trouble figuring out how to do this.  I haven't been able to find any VB examples that  show how to really use this data type.

What I want to do is have a History table with 4 fields.  HistoryID, TableID, RecordID, and History (XML).

I'm creating dynamic datasets with the the info I need to store for the history and I have not been able to figure out how to read or write to the XML field.  All I need is a link to some examples using VB.NET and if somebody can help, an example using a StrataFrame businessobject.

Any help with this is greatly appreciated.

Thanks!

By Trent L. Taylor - 1/28/2008

Really you may be better off creating a VarBinary(MAX) field and serializing the DataSet (or XML data) into that field.  I believe that this will be less complicated and produce better results.  Anytime that we have the need to store XML contents, we will generally use a VarChar(MAX) and store teh XML text or use a VarBinary(MAX) and store the Byte() array of the file.  Either way will work, and the VarChar(MAX) may be easier than storing it as a VarBinary byte array.  But this the approach that I would take.
By Crones - 1/28/2008

I'll look into trying that instead.

Thank you!

By Trent L. Taylor - 1/28/2008

No problem Smile