建议把生成的xml读取到文本框看看,应该有非法字符,xml对语法要求很严格

解决方案 »

  1.   

    不想直接用datagrid,而是想提供一个xml接口,如何实现?
    如果用ds.WriteXml("game.xml"),得写许多xml文件。
      

  2.   

    我发现一个问题,假设我原来的节点存放的是中文数据,将它更新为英文数据的时候,就会出现写错误,.net会搞错举例:
    原来中文数据:
    <Root>
    <Record>
        <User>中文</User>
        <Title>中文</Title>
        <DateTime>2003-3-24 10:19:50</DateTime>
        <Memo>中文</Memo>
      </Record>
    </Root>将之更新为英文或数字数据:
    <Root>
    <Record>
        <User>1</User>
        <Title>1</Title>
        <DateTime>2003-3-24 10:20:53</DateTime>
        <Memo>1</Memo>
      </Record>
    </Root>ecord>
    </Root>看到了吧?不知道.net怎么搞的
      

  3.   

    Fighters.aspx in ie's sourcefile<?xml version="1.0"?><FightersDataSet>
      <Fighters>
        <ID>1</ID>
        <name>刘备</name>
        <age>45</age>
        <fight>55</fight>
        <intelligence>88</intelligence>
        <belong>刘备</belong>
      </Fighters>
      <Fighters>
        <ID>2</ID>
        <name>关羽</name>
        <age>44</age>
        <fight>96</fight>
        <intelligence>88</intelligence>
        <belong>刘备</belong>
      </Fighters>
      <Fighters>
        <ID>3</ID>
        <name>张飞</name>
        <age>42</age>
        <fight>99</fight>
        <intelligence>18</intelligence>
        <belong>刘备</belong>
      </Fighters>
      <Fighters>
        <ID>4</ID>
        <name>诸葛亮</name>
        <age>37</age>
        <fight>33</fight>
        <intelligence>99</intelligence>
        <belong>刘备</belong>
      </Fighters>
    </FightersDataSet>
      

  4.   

    you are trying to load a string "Fighters.aspx" as an xml string, the worst you can do is
    xdd.Load("Fighters.aspx");but be warned, you might get errors