如何将xml文档的内容读出,显示在文本框内?

解决方案 »

  1.   

    数据读到datset里面以后,就按实际需要操作dataset就好了
      

  2.   

    我需要将xml文档的全部内容显示在richtextbox中。
      

  3.   

    导入System.xml
    有一些简单操作,一搜就找到列
      

  4.   

    XmlDocument doc = new XmlDocument();
    doc.Load(@"d:\sample.xml");
    richTextBox.Text = doc.InnerXml;xml大的话用xmltextreader或streamreader都可以
      

  5.   

    直接读就行,如下:
    private void button1_Click(object sender, EventArgs e)
     {
        this.richTextBox1.LoadFile(@"../../test.xml", RichTextBoxStreamType.PlainText);
      }
      

  6.   

    public void LoadFile (
    string path,
    RichTextBoxStreamType fileType
    )