在c#,mvc中如何将xmlweb服务返回的纯文本添加到数据表中

在c#,mvc中如何将xmlweb服务返回的纯文本添加到数据表中,c#,xml,asp.net-mvc-4,datatable,dataset,C#,Xml,Asp.net Mvc 4,Datatable,Dataset,我调用了一个web服务,它返回xml web服务的纯文本。我想要的是把那个纯文本(字符串)放到数据表中。我该怎么做呢。 这是我的密码 WebClient client = new WebClient(); string url = string.Format("https://www.someurl/products.ashx"); string response = client.DownloadString(url); 此

我调用了一个web服务,它返回xml web服务的纯文本。我想要的是把那个纯文本(字符串)放到数据表中。我该怎么做呢。 这是我的密码

           WebClient client = new WebClient();
           string url =  string.Format("https://www.someurl/products.ashx");
           string response = client.DownloadString(url);
此代码重新运行web服务的字符串(纯文本)。

请尝试以下操作:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Xml;

namespace ConsoleApplication56
{
    class Program
    {
        static void Main(string[] args)
        {
            string response = "";
            XmlReader reader = XmlReader.Create(response);
            DataSet ds = new DataSet();
            ds.ReadXml(reader);
        }
    }
}

您能给出一个xml示例以及要显示的结果吗?正如我所说,这段代码返回一个字符串。它有xml标记,但它是纯文本。不,我想将返回的纯文本放入数据集,然后放入表中。请帮助我。我想在视图中显示结果,你知道怎么做吗。我喜欢使用树状视图。请参阅以下帖子中的答案: