Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7551897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T10:37:04+00:00 2026-05-30T10:37:04+00:00

I have two strings. One string is having XML Data and another string is

  • 0

I have two strings. One string is having XML Data and another string is having corresponding XML Schema. I am trying to read the data in DataTable. It looks like it is not possible. I don’t want to use dataset. Is there a way I can combine the XML data and Schema into a memory stream and read?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T10:37:06+00:00Added an answer on May 30, 2026 at 10:37 am

    Put simply, no, there is not a way to load xml directly into a DataTable through methods on DataTable nor is there a way to create a DataTable directly from an arbitrary schema. Such operations must be done through DataSet; otherwise, you end up doing some very involved workarounds.

    There are some techniques you could apply using xml serialization that would be able to recreate a dataset from previously serialized xml. This does not allow for the use of an arbitrary schema though.

    You could also write code specifically that loads your XML (via XDocument, XmlDocument, or XmlTextReader) and creates a DataTable on the fly, but it’s not trivial to write and would likely take you quite some time. It’s also kind of reinventing the wheel.

    Essentially, the DataSet is the only class in that hierarchy with methods to process XML because Xml could contain any number of tables. To handle the broadest number of cases when you can make almost no assumptions about the XML, it has to be implemented at that level.

    You could also consider whether it’s appropriate to simply load the xml into an XDocument, validate it using the Validate extension method, and use Linq to Xml to query it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have two strings: one is XML data and the other is
I have a function which parses one string into two strings. In C# I
I would like to have a mapping which maps two string into one string.
I have two String arrays a,b. String a [] = {one,two,three}; String b []
I have two String.printable mysteries in the one question. First, in Python 2.6: >>>
I have two strings, one a key and one a value, which I would
I'm using .NET 3.5. I have two string arrays, which may share one or
Consider the following situation: We have two Localizable.string files, one in en.lproj and one
I have two overloaded methods, one with an optional parameter. void foo(string a) {
Suppose I have a string like this: one two three four five six seven

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.