Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
| Search | Today's Posts | Mark Forums Read
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old March 22nd, 2006, 07:11 AM
Registered User
 
Join Date: Mar 2006
Location: Lyngby, , Denmark.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to hhmoeller
Default Creating DataSet/DataTable from XML

Hi,

I am in the process of building a server/client app, exchanging messages in XML. One of these messages contain schema and dataset originating from a DataTable.
I would like to be able to read this XML back in to a DataSet or DataTable, but can only see an option to do this via a file. Any way of doing this with the XML available in a string variable?

HH

  #2 (permalink)  
Old March 22nd, 2006, 07:29 AM
mhkay's Avatar
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Most APIs that I know of provide a way of parsing XML supplied via an in-memory input stream, but the details vary depending on which products/platforms you are using. It helps to say.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
  #3 (permalink)  
Old March 22nd, 2006, 10:00 AM
Registered User
 
Join Date: Mar 2006
Location: Lyngby, , Denmark.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to hhmoeller
Default

I am using VB.NET.

  #4 (permalink)  
Old March 22nd, 2006, 10:34 AM
mhkay's Avatar
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Then if you look at the API specifications for System.Xml, you'll see that it's easy to invoke the parser to process an octet stream or character stream: it's not confined to processing a file.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
  #5 (permalink)  
Old March 22nd, 2006, 10:41 AM
Registered User
 
Join Date: Mar 2006
Location: Lyngby, , Denmark.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to hhmoeller
Default

That is true... no problem there... but I would like to be able to define a new dataset or datatable and load it with the schema and data from the recieved XML... the methods readxmlshema seems only to accept a filestream.



Similar Threads
Thread Thread Starter Forum Replies Last Post
Rearrange the column order in a datatable/dataset kiran_q8 ASP.NET 2.0 Professional 2 May 3rd, 2007 08:46 AM
DataTable belongs to another DataSet bmains ADO.NET 2 December 20th, 2005 12:24 AM
For Loop problem with DataSet\DataTable musa BOOK: ASP.NET Website Programming Problem-Design-Solution 2 December 25th, 2003 03:11 AM
For Loop problem with DataSet\DataTable musa BOOK: Professional C#, 2nd and 3rd Editions 1 December 24th, 2003 09:46 AM
For Loop problem with DataSet\DataTable musa BOOK: Beginning ASP.NET 1.0 0 December 23rd, 2003 06:31 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.