XML column


Author
Message
Keith Chisarik
Keith Chisarik
StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)
Group: StrataFrame Users
Posts: 939, Visits: 40K
I see. My BO mapper see both XML and variant tpye fields as type XMLReader and I am not sure what to do with that.

Greg, have you had a chance to run this by SF?

Keith Chisarik

Peter Jones
Peter Jones
Advanced StrataFrame User (506 reputation)Advanced StrataFrame User (506 reputation)Advanced StrataFrame User (506 reputation)Advanced StrataFrame User (506 reputation)Advanced StrataFrame User (506 reputation)Advanced StrataFrame User (506 reputation)Advanced StrataFrame User (506 reputation)Advanced StrataFrame User (506 reputation)Advanced StrataFrame User (506 reputation)
Group: Forum Members
Posts: 386, Visits: 2.1K
Hi Keith,



Kind of although the XML column is in table which is accessed via a BO. The XML data is mapped in the BO Mapper as System.String.



The data is converted into a ADO DataSet because the DevExpress grid understands what that is can parse and render it automatically.



Cheers, Peter
Keith Chisarik
Keith Chisarik
StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)
Group: StrataFrame Users
Posts: 939, Visits: 40K
Greg, thank you very much. I have an immediate need for this, will be anxiously awaiting an answer on the support for these field types within SF.

Keith Chisarik
Keith Chisarik
Keith Chisarik
StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)
Group: StrataFrame Users
Posts: 939, Visits: 40K
Thanks for the post. So you bypass the use of a SF business object when it comes to using the XML column and just use straight ADO/.NET databinding?

Keith Chisarik
Peter Jones
Peter Jones
Advanced StrataFrame User (506 reputation)Advanced StrataFrame User (506 reputation)Advanced StrataFrame User (506 reputation)Advanced StrataFrame User (506 reputation)Advanced StrataFrame User (506 reputation)Advanced StrataFrame User (506 reputation)Advanced StrataFrame User (506 reputation)Advanced StrataFrame User (506 reputation)Advanced StrataFrame User (506 reputation)
Group: Forum Members
Posts: 386, Visits: 2.1K
Hi Keith,



This may help.



We have a semi generic method of creating interfaces into ERP systems and gather the data into XML format and store that data in a SQL table. The table we use has column called ERXIFData and its data type is XML.



When we want to show contents of the ERXIFData we use a DevExpress grid and pass to it a dataset that has been generated from the XML data. One instance of ERXIFData could contain contain several 100 rows of data.



The code we use is:



   Case clsENU.ERPIFType.ERPBoughtIn

ShowAnInterface(Me.luERX.Properties.GetDataSourceValue("ERXIFData", Me.luERX.ItemIndex).ToString, Me.GridControl9, Me.GridView9, Me.XMLDataSetBoughtIn)







Private Sub ShowAnInterface(ByVal ERXIFData As String, _

ByRef Grid As DevExpress.XtraGrid.GridControl, _

ByRef GridView As DevExpress.XtraGrid.Views.Grid.GridView, _

ByRef ds As System.Data.DataSet)





Dim objXmlNamespaceManager As New System.Xml.XmlNamespaceManager(New System.Xml.NameTable)



Dim reader As New System.Xml.XmlTextReader(ERXIFData, _

System.Xml.XmlNodeType.Document, _

New System.Xml.XmlParserContext(Nothing, _

objXmlNamespaceManager, _

"", _

System.Xml.XmlSpace.None))

ds.ReadXml(reader)



Grid.DataSource = ds.Tables(0)



Grid.ForceInitialize()



GridView.UpdateSummary()

clsFU.LocaliseAllControls(Grid)

reader.Close()



End Sub





And that's it.



The DevExpress Grid renders the columns in the dataset automatically (refer Grid.DataSource = ds.Tables(0)), i.e. we can pass any pieces of XML to the grid (including hierarchical) and it renders correctly.



To pass in the ERXIFData column we first convert it to String.



Cheers, Peter
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.4K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Keith, I'll check on this with Trent and the development team regarding this and also regarding support for the other new data types (date, time, hierarchal ID, etc).
Keith Chisarik
Keith Chisarik
StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)
Group: StrataFrame Users
Posts: 939, Visits: 40K
SQL 2008 - I just hit the same exact issue with the same field as a SQL_VARIANT, Strataframe types the field as XmlReader and I dont know how to interact with it (and cant find much in the way of documentation).

I went the variant route because of the issue I had with the XML field type Sad

I am doing this because I need to store user defined data.

Keith Chisarik

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.4K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Keith, is this on SQL Server 2005?
Keith Chisarik
Keith Chisarik
StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)
Group: StrataFrame Users
Posts: 939, Visits: 40K
Lots of issues with this mainly due to not finding much in the way of documentation for this column type (if it exists I cant find it). There are no XML fields in Strataflix sample.

I am able to add and save a row in a BO that contains an XML column, but I cannot access it (string conversion error) without going down to the underlying datatable, I also cannot save an update to the field as I get "The XML data type cannot be compared or sorted, except when using the IS NULL operator."

Anyone have an experience using XML columns with SF that cant point me in the right direction or provide some support on this would be appreciated. 

Keith Chisarik

Keith Chisarik
Keith Chisarik
StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)
Group: StrataFrame Users
Posts: 939, Visits: 40K
Thanks but that is not what I am looking for. I am looking for sample code or documentation on the SF support for XML type fields. XML fields are typed as XmlReader on the business object and I am having a hard time accessing the data in them where I have no trouble using vanilla ADO.

Keith Chisarik
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