Click here to Skip to main content
15,797,683 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In a web application project, I used the following code to load an xml file:
string url = "http://localhost:48677/Service1.svc/GetDataSet";
 var webClient = new System.Net.WebClient();
 string ReadData = webClient.DownloadString(url);

The xml file posted in the URL is sourced a dataset. It consists of 2 parts: The 1st part is the schema part, like that:
<xs:schema xmlns=...>

The 2nd part displays the data values, like that below:
<diffgr:difffram ...>
  <NewDataSet xmlns="">
    <MyData diffgr:id=...>

I have tried different approaches to try to convert/parse the ReadData into a DataSet, but not successful. Please advise me how to implement this conversion if you know. Thanks.
Updated 9-Sep-13 11:00am

The simplest way to do this is by using xsd.exe[^]

You could then use something like cs-script[^] to execute the generated code at runtime.

Best regards
Espen Harlinn
Share this answer
Share this answer
To Ridoy: Using the approach in Reading XML through C#, I can retrieve the records well. Thanks.
To Espen Harlinn: Thanks for your resonse.
Share this answer
ridoy 10-Sep-13 12:08pm    
you should use it as a comment,not a solution.Use Have a Question or Comment? button to do a comment.Glad to help you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900