ORM to XML

2 posts, 0 answers
  1. Michael
    Michael avatar
    29 posts
    Member since:
    Nov 2010

    Posted 08 Apr 2011 Link to this post

    How I can get XML data from ORM?

    e.g.

    public StoreDB pgData = new StoreDB();
    public string ReadStorage()
    {
        var result = from c in pgData.Objekats
                     orderby c.Naziv
                     select c;
       // how to convert, something like :
        string myXML = result.toXML()???
      // or there is another way?
    }

    Something like this :
    string myXML;            
    DataSet myDS = new DataSet();
    OleDbCommand MyCmd = new OleDbCommand(cSQL, oCn1.oCon);
    OleDbDataAdapter myDA = new OleDbDataAdapter(MyCmd);
    oCn1.ConOpen();
    myDA.Fill(myDS, "Cursor1");
    myXML = myDS.GetXml();


    Thanks, Michael.
  2. Alexander
    Admin
    Alexander avatar
    727 posts

    Posted 13 Apr 2011 Link to this post

    Hello Michael,

    I am afraid that currently OpenAccess does not provide such functionality. If the objects retrieved by the Linq query do not have circular references, you should be able to achieve similar results by using the standard XMLSerializer class and serializing the query result.

    Best wishes,
    Alexander
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
Back to Top